def is_prime(x):
    if x == 2:
        return True
    for i in range(2, int(x**0.5) + 1):
        if x % i == 0:
            return False
    return True


if __name__ == '__main__':
    n = int(raw_input())
    cnt = 0
    for i in range(n):
        x = int(raw_input())
        if is_prime(x):
            cnt += 1
    print cnt
