#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math


def isprime(n):
    if n == 2:
        return True
    elif n < 2 or n % 2 == 0:
        return False
    else:
        for i in range(3, math.floor(math.sqrt(n)) + 1, 2):
            if n % i == 0:
                return False
        else:
            return True


def main():
    n = int(input())
    ms = (int(input()) for i in range(n))
    print(len(list(filter(isprime, ms))))

if __name__ == "__main__":
    main() import math math def isprime(n):
    if n == 2:
        return True
    elif n < 2 or n % 2 == 0:
        return False
    else:
        for i in range(3, math.floor(math.sqrt(n)) + 1, 2):
            if n % i == 0:
                return False
        else:
            return True isprime if n == 2:
        return True
    elif n < 2 or n % 2 == 0:
        return False
    else:
        for i in range(3, math.floor(math.sqrt(n)) + 1, 2):
            if n % i == 0:
                return False
        else:
            return True n == 2 n 2 return True True elif n < 2 or n % 2 == 0:
        return False
     n < 2 or n % 2 == 0 n < 2 n 2 n % 2 == 0 n % 2 n 2 0 return False False for i in range(3, math.floor(math.sqrt(n)) + 1, 2):
            if n % i == 0:
                return False
        else:
            return True i range(3, math.floor(math.sqrt(n)) + 1, 2) range 3 math.floor(math.sqrt(n)) + 1 math.floor(math.sqrt(n)) math.floor math floor math.sqrt(n) math.sqrt math sqrt n 1 2 if n % i == 0:
                return False
         n % i == 0 n % i n i 0 return False False return True True n n def main():
    n = int(input())
    ms = (int(input()) for i in range(n))
    print(len(list(filter(isprime, ms)))) main n = int(input()) n int(input()) int input() input int(input()) for i in range(n) for i in range(n) i range(n) range n for i in range(n) int(input()) int input() input ms = (int(input()) for i in range(n)) ms (int(input()) for i in range(n)) print(len(list(filter(isprime, ms)))) print len(list(filter(isprime, ms))) len list(filter(isprime, ms)) list filter(isprime, ms) filter isprime ms if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    ms = (int(input()) for i in range(n))
    print(len(list(filter(isprime, ms)))) def main():
    n = int(input())
    ms = (int(input()) for i in range(n))
    print(len(list(filter(isprime, ms)))) main def isprime(n):
    if n == 2:
        return True
    elif n < 2 or n % 2 == 0:
        return False
    else:
        for i in range(3, math.floor(math.sqrt(n)) + 1, 2):
            if n % i == 0:
                return False
        else:
            return True def isprime(n):
    if n == 2:
        return True
    elif n < 2 or n % 2 == 0:
        return False
    else:
        for i in range(3, math.floor(math.sqrt(n)) + 1, 2):
            if n % i == 0:
                return False
        else:
            return True isprime
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math


def isprime(n):
    if n == 2:
        return True
    elif n < 2 or n % 2 == 0:
        return False
    else:
        for i in range(3, math.floor(math.sqrt(n)) + 1, 2):
            if n % i == 0:
                return False
        else:
            return True


def main():
    n = int(input())
    ms = (int(input()) for i in range(n))
    print(len(list(filter(isprime, ms))))

if __name__ == "__main__":
    main()