import java.io.*;
import java.util.*;
import java.math.*;

public class invaders_ab implements Runnable {

	final int MAX_N = 100;
		
	private void solve() throws IOException {
		int n = in.nextInt();
		myAssert(1 <= n && n <= MAX_N);
		int p = in.nextInt() - 1;
		myAssert(0 <= p && p < n);
		int ans = 0;
		int[] a = new int[n];
		for (int i = 0; i < n; ++i) {
			a[i] = in.nextInt();
			myAssert(1 <= a[i] && a[i] <= 100);
			ans += a[i];
		}
		out.println(ans + n - 1 + Math.min(p, n - p - 1));
	}

	void myAssert(boolean e) {
		if (!e) {
			throw new Error();
		}
	}
	
	final String FILE_NAME = "invaders";

	SimpleScanner in;
	PrintWriter out;

	@Override
	public void run() {
		try {
			in = new SimpleScanner(new FileReader(FILE_NAME + ".in"));
			out = new PrintWriter(FILE_NAME + ".out");
			solve();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}

	public static void main(String[] args) {
		new Thread(new invaders_ab()).start();
	}

	class SimpleScanner extends BufferedReader {

		private StringTokenizer st;
		private boolean eof;

		public SimpleScanner(Reader a) {
			super(a);
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(readLine());
				} catch (Exception e) {
					eof = true;
					return "";
				}
			}
			return st.nextToken();
		}

		boolean seekEof() {
			String s = next();
			if ("".equals(s) && eof)
				return true;
			st = new StringTokenizer(s + " " + st.toString());
			return false;
		}

		private String cnv(String s) {
			if (s.length() == 0)
				return "0";
			return s;
		}

		int nextInt() {
			return Integer.parseInt(cnv(next()));
		}

		double nextDouble() {
			return Double.parseDouble(cnv(next()));
		}

		long nextLong() {
			return Long.parseLong(cnv(next()));
		}
	}
}