def main():
    n = int(input())
    ans = 0
    for i in range(n):
        x = int(input())
        flag = True
        for j in range(2, x):
            if x % j == 0:
                flag = False
                break
        if flag:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()
