import java.util.*;


public class Main{
	public static void main(String args[]){
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n+1];
  		int count =0;
		a[0]= 0;
		
		
		for(int i=1;i<=n;i++){
			int b = sc.nextInt();
			a[i] = b;
		}
			Arrays.sort(a);
			
			
			for(int j=0;j<n;j++){
				    if(a[j] < a[j+1]){
						count++;
				    }
			}
			
		System.out.println(count);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String args[]){
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n+1];
  		int count =0;
		a[0]= 0;
		
		
		for(int i=1;i<=n;i++){
			int b = sc.nextInt();
			a[i] = b;
		}
			Arrays.sort(a);
			
			
			for(int j=0;j<n;j++){
				    if(a[j] < a[j+1]){
						count++;
				    }
			}
			
		System.out.println(count);
	}
} Main public static void main(String args[]){
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n+1];
  		int count =0;
		a[0]= 0;
		
		
		for(int i=1;i<=n;i++){
			int b = sc.nextInt();
			a[i] = b;
		}
			Arrays.sort(a);
			
			
			for(int j=0;j<n;j++){
				    if(a[j] < a[j+1]){
						count++;
				    }
			}
			
		System.out.println(count);
	} main {
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n+1];
  		int count =0;
		a[0]= 0;
		
		
		for(int i=1;i<=n;i++){
			int b = sc.nextInt();
			a[i] = b;
		}
			Arrays.sort(a);
			
			
			for(int j=0;j<n;j++){
				    if(a[j] < a[j+1]){
						count++;
				    }
			}
			
		System.out.println(count);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] a = new int[n+1]; a new int[n+1] n+1 n 1 int count =0; count 0 a[0]= 0 a[0] a 0 0 for(int i=1;i<=n;i++){
			int b = sc.nextInt();
			a[i] = b;
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			int b = sc.nextInt();
			a[i] = b;
		} {
			int b = sc.nextInt();
			a[i] = b;
		} int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc a[i] = b a[i] a i b Arrays.sort(a) Arrays.sort Arrays a for(int j=0;j<n;j++){
				    if(a[j] < a[j+1]){
						count++;
				    }
			} int j=0; int j=0; j 0 j<n j n j++ j++ j {
				    if(a[j] < a[j+1]){
						count++;
				    }
			} {
				    if(a[j] < a[j+1]){
						count++;
				    }
			} if(a[j] < a[j+1]){
						count++;
				    } a[j] < a[j+1] a[j] a j a[j+1] a j+1 j 1 {
						count++;
				    } count++ count System.out.println(count) System.out.println System.out System System.out count String args[] args public class Main{
	public static void main(String args[]){
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n+1];
  		int count =0;
		a[0]= 0;
		
		
		for(int i=1;i<=n;i++){
			int b = sc.nextInt();
			a[i] = b;
		}
			Arrays.sort(a);
			
			
			for(int j=0;j<n;j++){
				    if(a[j] < a[j+1]){
						count++;
				    }
			}
			
		System.out.println(count);
	}
} public class Main{
	public static void main(String args[]){
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n+1];
  		int count =0;
		a[0]= 0;
		
		
		for(int i=1;i<=n;i++){
			int b = sc.nextInt();
			a[i] = b;
		}
			Arrays.sort(a);
			
			
			for(int j=0;j<n;j++){
				    if(a[j] < a[j+1]){
						count++;
				    }
			}
			
		System.out.println(count);
	}
} Main
import java.util.*;


public class Main{
	public static void main(String args[]){
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n+1];
  		int count =0;
		a[0]= 0;
		
		
		for(int i=1;i<=n;i++){
			int b = sc.nextInt();
			a[i] = b;
		}
			Arrays.sort(a);
			
			
			for(int j=0;j<n;j++){
				    if(a[j] < a[j+1]){
						count++;
				    }
			}
			
		System.out.println(count);
	}
}