import java.util.*;

public class Main{
  	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
 
		int N = sc.nextInt();			//N
 		int[] A = new int[N];
      	int num = 0;
      	for(int i=0;i<N;i++){
          int j = 0;
          int k = sc.nextInt();
          while(j<num&&A[j]!=k){
            j++;
          }
          if(j>=num){
            A[j]=k;
            num++;
          }
        }
      System.out.println(num);
    }
} import java.util.*; util.* java public class Main{
  	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
 
		int N = sc.nextInt();			//N
 		int[] A = new int[N];
      	int num = 0;
      	for(int i=0;i<N;i++){
          int j = 0;
          int k = sc.nextInt();
          while(j<num&&A[j]!=k){
            j++;
          }
          if(j>=num){
            A[j]=k;
            num++;
          }
        }
      System.out.println(num);
    }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
 
		int N = sc.nextInt();			//N
 		int[] A = new int[N];
      	int num = 0;
      	for(int i=0;i<N;i++){
          int j = 0;
          int k = sc.nextInt();
          while(j<num&&A[j]!=k){
            j++;
          }
          if(j>=num){
            A[j]=k;
            num++;
          }
        }
      System.out.println(num);
    } main {
		Scanner sc = new Scanner(System.in);
 
		int N = sc.nextInt();			//N
 		int[] A = new int[N];
      	int num = 0;
      	for(int i=0;i<N;i++){
          int j = 0;
          int k = sc.nextInt();
          while(j<num&&A[j]!=k){
            j++;
          }
          if(j>=num){
            A[j]=k;
            num++;
          }
        }
      System.out.println(num);
    } 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]; A new int[N] N int num = 0; num 0 for(int i=0;i<N;i++){
          int j = 0;
          int k = sc.nextInt();
          while(j<num&&A[j]!=k){
            j++;
          }
          if(j>=num){
            A[j]=k;
            num++;
          }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
          int j = 0;
          int k = sc.nextInt();
          while(j<num&&A[j]!=k){
            j++;
          }
          if(j>=num){
            A[j]=k;
            num++;
          }
        } {
          int j = 0;
          int k = sc.nextInt();
          while(j<num&&A[j]!=k){
            j++;
          }
          if(j>=num){
            A[j]=k;
            num++;
          }
        } int j = 0; j 0 int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc while(j<num&&A[j]!=k){
            j++;
          } j<num&&A[j]!=k j<num j num A[j]!=k A[j] A j k {
            j++;
          } j++ j if(j>=num){
            A[j]=k;
            num++;
          } j>=num j num {
            A[j]=k;
            num++;
          } A[j]=k A[j] A j k num++ num System.out.println(num) System.out.println System.out System System.out num String[] args args public class Main{
  	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
 
		int N = sc.nextInt();			//N
 		int[] A = new int[N];
      	int num = 0;
      	for(int i=0;i<N;i++){
          int j = 0;
          int k = sc.nextInt();
          while(j<num&&A[j]!=k){
            j++;
          }
          if(j>=num){
            A[j]=k;
            num++;
          }
        }
      System.out.println(num);
    }
} public class Main{
  	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
 
		int N = sc.nextInt();			//N
 		int[] A = new int[N];
      	int num = 0;
      	for(int i=0;i<N;i++){
          int j = 0;
          int k = sc.nextInt();
          while(j<num&&A[j]!=k){
            j++;
          }
          if(j>=num){
            A[j]=k;
            num++;
          }
        }
      System.out.println(num);
    }
} Main
import java.util.*;

public class Main{
  	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
 
		int N = sc.nextInt();			//N
 		int[] A = new int[N];
      	int num = 0;
      	for(int i=0;i<N;i++){
          int j = 0;
          int k = sc.nextInt();
          while(j<num&&A[j]!=k){
            j++;
          }
          if(j>=num){
            A[j]=k;
            num++;
          }
        }
      System.out.println(num);
    }
}