ans = 0
n = gets.to_i

def true_or_false (a)
    a_heihou = a**(1/2.0)
    hh = a_heihou.floor
    if a == 2
        return true
    elsif a > 2 && a % 2 == 0
        return false
    else
        i = 3
        while i <= hh
            if a % i == 0
                return false
            end
            i += 2
        end
        return true
    end
end


n.times do
    h = gets.to_i
    ans += 1 if true_or_false(h)
end
puts ans
