def simple(x):
count=0
if x==1 or x==0:
return False
for i in range(1,x//2 + 1):
if x%i==0:
count+=1
if count>1:
return True
n=int(input())
while n>=2:
if simple(n):
print(count)
def simple(x):
count=0
if x==1 or x==0:
return False
for i in range(1,x//2 + 1):
if x%i==0:
count+=1
if count>1:
return False
return True
count=0
n=int(input())
while n>=2:
if simple(n):
count+=1
n=int(input())
print(count)