def main() :
    n = int(input())
    nums = []
    for i in range(0, n) :
        x = int(input())
        nums.append(x)

    count = 0
    judge = 0
    for i in nums :
        print(i)
        for j in range(2, i) :
            if (i % j) != 0 :
                judge += 0
            else :
                judge += 1

        if judge == 0 :
            count += 1

    print(count)


if __name__ == '__main__' :
    main()