public static void main(String args[])
    {
        Scanner obj=new Scanner(System.in);
        System.out.print("Enter the number of numbers to be inserted:");
        int n=obj.nextInt();
        int arr[]=new int[n];
        int brr[]=new int[n];
        for(int i=0;i<n;++i)
        {
            System.out.print("Enter the number:");
            arr[i]=obj.nextInt();
        }
        
        for(int i=0;i<n;++i)
        {
            for(int j=i-1;j>=0;--j)
            {
                if(arr[j]==arr[i])
                {
                    brr[i]=-1;
                    break;
                }
            }
            if(brr[i]!=-1)
            {
               for(int j=i;j<n;++j)
               {
                   if(arr[j]==arr[i])
                   {
                       ++brr[i];
                   }
                }
            }
        }
        
        for(int i=0;i<n;++i)
        {
            if(brr[i]!=-1)
            {
                System.out.println("Frequency of "+arr[i]+" = "+brr[i]);
            }
        }
    }