There are n workers in a company, each of them has a unique id from 1 to n. Exaclty one of them is a chief, his id is s. Each worker except the chief has exactly one immediate superior.

There was a request to each of the workers to tell how how many superiors (not only immediate). Worker's superiors are his immediate superior, the immediate superior of the his immediate superior, and so on. For example, if there are three workers in the company, from which the first is the chief, the second worker's immediate superior is the first, the third worker's immediate superior is the second, then the third worker has two superiors, one of them is immediate and one not immediate. The chief is a superior to all the workers except himself.

Some of the workers were in a hurry and made a mistake. You are to find the minimum number of workers that could make a mistake.

Input

The first line contains two positive integers n and s (1 ≤ n ≤ 2·105, 1 ≤ s ≤ n) — the number of workers and the id of the chief.

The second line contains n integers a1, a2, ..., an (0 ≤ ai ≤ n - 1), where ai is the number of superiors (not only immediate) the worker with id i reported about.

Output

Print the minimum number of workers that could make a mistake.

Examples

Input

3 2
2 0 2


Output

1


Input

5 3
1 0 0 4 1


Output

2

Note

In the first example it is possible that only the first worker made a mistake. Then: 

  * the immediate superior of the first worker is the second worker, 
  * the immediate superior of the third worker is the first worker, 
  * the second worker is the chief. 
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class Solution{
	
	static final int maxn = (int)2e5+5;
	
	
	
    public static void main(String[] args) throws IOException {
     
    	FastScanner fs = new FastScanner();
    	PrintWriter out = new PrintWriter(System.out);
    	
    	
    		
    	int tt = 1;
    	while(tt-->0) {
    		
    		int n = fs.nextInt(), s = fs.nextInt()-1;
    		int[] f = new int[maxn];
    		
    		int[] a = new int[n];
    		
    		int cnt = 0;
    		int ans = 0;
    		
    		
    		for(int i=0;i<n;i++) {
    			a[i] = fs.nextInt();
    			if(i==s) {
    				if(a[i]!=0) {
    					ans++; a[i] = 0;
    				}
    				continue;
    			}
    			if(a[i]==0) cnt++;
    			f[a[i]]++;
    		}
    		f[0] = 1;
    		
    		ruffleSort(a);
    		
    		for(int i=0;i<maxn && cnt>0;i++) {
    			if(f[i]==0) {
    				f[i] = 1; cnt--;ans++;
    			}
    		}
    		
    		int i = 0;
    		int j = n-1;
    		
    		while(j>0) {
    			while(i<n && f[i]!=0) i++;
    			if(i>a[j]) break;
    			f[i]++;
    			f[a[j]]--;
    			ans++;
    			j--;
    		}
    		
    		out.println(ans);
    		
    		
    	}
    	
    		
    		
    		
    	out.close();
    		
    }
    
   
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    static final Random random=new Random();
    	
    static void ruffleSort(int[] a) {
    	int n=a.length;//shuffle, then sort 
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); int temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }
   
  
    
    	
    	
    static class FastScanner{
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st = new StringTokenizer("");
     
    	public String next(){
    		while(!st.hasMoreElements()){
    			try{
    				st = new StringTokenizer(br.readLine());
    			} catch(IOException e){
    				e.printStackTrace();
    			}
    		}
    		return st.nextToken();
    	}
    		
    	public String nextLine() throws IOException {
    		return br.readLine();
    	}
    		
    	public int nextInt(){
    		return Integer.parseInt(next());
    	}
     
    	public int[] readArray(int n){
    		int[] a = new int[n];
    		for(int i=0;i<n;i++)
    			a[i] = nextInt();
    		return a;
    	}
    		
    	public long nextLong() {
    		return Long.parseLong(next());
    	}
    		
    	public char nextChar() {
    		return next().toCharArray()[0];
    	}
    }
   	
}
