def hoge(z):
    yuki = 0
    for i in range(2, z):
        if z % i == 0:
            yuki += 1
        if yuki:
            return False
    return True

if __name__ == '__main__':
    n = int(input())
    c = 0
    for _ in range(n):
        if hoge(int(input())):
            c += 1
    print (c)
