I came up with this logic to count the duplicate 1 take input for list length 2 take input of list 3 search in list for the values from zero to last index increment the counter. I am getting error can anyone help to fix it, I know my this not accurate way to do this can someone help me out
n = int(input())
l1=[]
for i in range(n):
    l1.append(input())
print(l1)    
count1=0
count2=0
count3=0
count4=0    
for j in range(n):
       if 1 in l1[0,n-1]:
            count1 =count1+1
       elif 2 in l1(0,n-1):   
            count2=count2+1
       elif 3 in l1(0,n-1):
           count3= count3+1
       elif 4 in l1(0,n-1):
            count4=count4+1          
print(count1)  
input 4 1 1 2 3 4 output should be 2
 
     
    