def composite(d,n,s):
    for a in (2,3,5,7):
        p = False
        if pow(a,d,n) == 1:
            continue
        for i in range(s):
            if pow(a, 2**i * d, n) == n-1:
                p = True
                break
        if not p:
            return True
    return False

def is_prime(n):
    if n in (2,3,5,7):
        return True
    elif 0 in (n%2,n%3,n%5,n%7):
        return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return not composite(d,n,s)
r = []
n = int(input())
for i in range(n):
  n = int(input())
  if is_prime(n):
      if n not in r:
          r.append(n)

print(len(r)) def composite(d,n,s):
    for a in (2,3,5,7):
        p = False
        if pow(a,d,n) == 1:
            continue
        for i in range(s):
            if pow(a, 2**i * d, n) == n-1:
                p = True
                break
        if not p:
            return True
    return False composite for a in (2,3,5,7):
        p = False
        if pow(a,d,n) == 1:
            continue
        for i in range(s):
            if pow(a, 2**i * d, n) == n-1:
                p = True
                break
        if not p:
            return True
     a (2,3,5,7) 2 3 5 7 p = False p False if pow(a,d,n) == 1:
            continue
         pow(a,d,n) == 1 pow(a,d,n) pow a d n 1 continue for i in range(s):
            if pow(a, 2**i * d, n) == n-1:
                p = True
                break
         i range(s) range s if pow(a, 2**i * d, n) == n-1:
                p = True
                break
         pow(a, 2**i * d, n) == n-1 pow(a, 2**i * d, n) pow a 2**i * d 2**i 2 i d n n-1 n 1 p = True p True break if not p:
            return True
     not p p return True True return False False d d n n s s def is_prime(n):
    if n in (2,3,5,7):
        return True
    elif 0 in (n%2,n%3,n%5,n%7):
        return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return not composite(d,n,s) is_prime if n in (2,3,5,7):
        return True
    elif 0 in (n%2,n%3,n%5,n%7):
        return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return not composite(d,n,s) n in (2,3,5,7) n (2,3,5,7) 2 3 5 7 return True True elif 0 in (n%2,n%3,n%5,n%7):
        return False
     0 in (n%2,n%3,n%5,n%7) 0 (n%2,n%3,n%5,n%7) n%2 n 2 n%3 n 3 n%5 n 5 n%7 n 7 return False False d,s = n-1, 0 d n-1 n 1 s 0 while not d%2:
            d,s = d>>1,s+1
         not d%2 d%2 d 2 d,s = d>>1,s+1 d d>>1 d 1 s s+1 s 1 return not composite(d,n,s) not composite(d,n,s) composite(d,n,s) composite d n s n n r = [] r [] n = int(input()) n int(input()) int input() input for i in range(n):
  n = int(input())
  if is_prime(n):
      if n not in r:
          r.append(n) i range(n) range n n = int(input()) n int(input()) int input() input if is_prime(n):
      if n not in r:
          r.append(n) is_prime(n) is_prime n if n not in r:
          r.append(n) n not in r n r r.append(n) r.append r append n print(len(r)) print len(r) len r n = int(input()) int(input()) n r = [] [] r def composite(d,n,s):
    for a in (2,3,5,7):
        p = False
        if pow(a,d,n) == 1:
            continue
        for i in range(s):
            if pow(a, 2**i * d, n) == n-1:
                p = True
                break
        if not p:
            return True
    return False def composite(d,n,s):
    for a in (2,3,5,7):
        p = False
        if pow(a,d,n) == 1:
            continue
        for i in range(s):
            if pow(a, 2**i * d, n) == n-1:
                p = True
                break
        if not p:
            return True
    return False composite n = int(input()) int(input()) n def is_prime(n):
    if n in (2,3,5,7):
        return True
    elif 0 in (n%2,n%3,n%5,n%7):
        return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return not composite(d,n,s) def is_prime(n):
    if n in (2,3,5,7):
        return True
    elif 0 in (n%2,n%3,n%5,n%7):
        return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return not composite(d,n,s) is_prime
def composite(d,n,s):
    for a in (2,3,5,7):
        p = False
        if pow(a,d,n) == 1:
            continue
        for i in range(s):
            if pow(a, 2**i * d, n) == n-1:
                p = True
                break
        if not p:
            return True
    return False

def is_prime(n):
    if n in (2,3,5,7):
        return True
    elif 0 in (n%2,n%3,n%5,n%7):
        return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return not composite(d,n,s)
r = []
n = int(input())
for i in range(n):
  n = int(input())
  if is_prime(n):
      if n not in r:
          r.append(n)

print(len(r))