import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class invaders_sm {

	void solve() {
		int n = nextInt();
		assert 1 <= n && n <= 100;
		int p = nextInt();
		assert 1 <= p && p <= n;
		int s = 0;
		for (int i = 0; i < n; i++) {
			int a = nextInt();
			assert 1 <= a && a <= 100;
			s += a;
		}
		out.println(s + Math.min(p - 1, n - p) + n - 1);
	}

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;

	void run() {
		try {
			br = new BufferedReader(new FileReader("invaders.in"));
			out = new PrintWriter(new FileWriter("invaders.out"));
			solve();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	String nextToken() {
		try {
			while (st == null || !st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
			}
			return st.nextToken();
		} catch (Exception e) {
			return "0";
		}
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	public static void main(String[] args) {
		new invaders_sm().run();
	}
}
