# 1978번. 소수 찾기
n=int(input())nList=list(map(int,input().split()))m=1000# 소수 리스트 만들기
defp(m):pList=[True]*mk=int(m**0.5)foriinrange(2,k):ifpList[i]:forjinrange(i+i,m,i):pList[j]=Falsereturn[iforiinrange(2,m)ifpList[i]]answer=0pList=p(m)fornuminnList:ifnuminpList:answer+=1print(answer)