CodeEff/ECCO huggingface dataset:
# Original solution
import random


def slv(N, C, X, V):
    # cal_l = 0
    # move = 0
    # for x, v in zip(X, V):
    #     if x-move > v:
    #         break
    #     cal_l += v
    #     move = x
    # cal_l -= move

    # cal_r = 0
    # move = 0
    # tmp =list(zip(X, V))
    # for x, v in tmp[::-1]:
    #     if (C-x)-move > v:
    #         break
    #     cal_r += v
    #     move = C - x
    # cal_r -= move

    # print(cal_l, cal_r)

    ans_l = [(0, 0)]
    for x, v in zip(X, V):
        ans_l.append((x, ans_l[-1][1] + v))

    ans_r = [(0, 0)]
    for x, v in list(zip(X, V))[::-1]:
        ans_r.append((C-x, ans_r[-1][1] + v))


    ans_l_r = []
    for i, a in enumerate(ans_l):
        tmp = 0
        for b in ans_r[:-i]:
            c = a[1] + b[1] - 2*a[0] - b[0]
            tmp = max(tmp, c)
        ans_l_r.append( tmp)
    ans_r_l = []
    for i, a in enumerate(ans_r):
        tmp = 0
        for b in ans_l[:-i]:
            c = a[1] + b[1] - 2*a[0] - b[0]
            tmp = max(tmp, c)
        ans_r_l.append( tmp)

    
    # print(ans_l)
    # print(ans_r)
    l = max([x[1]-x[0] for x in ans_l])
    r = max([x[1]-x[0] for x in ans_r])
    lr = max(ans_l_r)
    rl = max(ans_r_l)


    return max(l, r, lr, rl)



def main():
    N, C = list(map(int, input().split()))
    X = []
    V = []
    for _ in range(N):
        x, v = list(map(int, input().split()))
        X.append(x)
        V.append(v)
    print((slv(N, C, X, V)))


if __name__ == '__main__':
    main()

# Optimized solution
import random


def slv(N, C, X, V):
    ans_l = [(0, 0)]
    ans_l_ = [0]
    for x, v in zip(X, V):
        ans_l_.append(max(ans_l_[-1], ans_l[-1][1] + v - x))
        ans_l.append((x, ans_l[-1][1] + v))
    ans_l_.pop(0)
    ans_l.pop(0)

    ans_r = [(0, 0)]
    ans_r_ = [0]
    for x, v in list(zip(X, V))[::-1]:
        ans_r_.append(max(ans_r_[-1], ans_r[-1][1] + v - (C-x)))
        ans_r.append((C-x, ans_r[-1][1] + v))
    ans_r_.pop(0)
    ans_r.pop(0)
        

    # print('p1')

    ans_l_r = []
    for i, a in enumerate(ans_l[:-1], 1):
        # print(ans_r_[N-i-1],  a[1]-2*a[0])
        ans_l_r.append(ans_r_[N-i-1] + a[1]-2*a[0])

    # print('p2')
    ans_r_l = []
    for i, a in enumerate(ans_r[:-1], 1):
        # print(ans_l_[N-i-1],  a[1]-2*a[0])
        ans_r_l.append(ans_l_[N-i-1] + a[1]-2*a[0])

    l = max([x[1]-x[0] for x in ans_l])
    r = max([x[1]-x[0] for x in ans_r])
    lr = 0 if not ans_l_r else max(ans_l_r)
    rl = 0 if not ans_r_l else max(ans_r_l)

    # print(ans_l)
    # print(ans_l_)
    # print(ans_r)
    # print(ans_r_)

    # print(l, r, lr, rl)
    return max(l, r, lr, rl)



def main():
    N, C = list(map(int, input().split()))
    X = []
    V = []
    for _ in range(N):
        x, v = list(map(int, input().split()))
        X.append(x)
        V.append(v)

    # N = 100000
    # C = 1000000000000
    # X = [1]
    # V = [100]
    # for _ in range(N):
    #     X.append(X[-1]+random.randint(1, 10000))
    #     V.append(random.randint(1, 10000))

    print((slv(N, C, X, V)))


if __name__ == '__main__':
    main()
# Original solution
n, c = list(map(int, input().split()))

lx, lv = [], []

for _ in range(n):
    tmpx, tmpv = list(map(int, input().split()))
    lx.append(tmpx)
    lv.append(tmpv)

lux = [c-x for x in reversed(lx)]

#両方向の累積和
tmpv1, tmpv2 = 0,0
vc, vuc = [],[]
for i in range(n):
    tmpv1 += lv[i]
    tmpv2 += lv[n-1-i]
    _ = [x.append(y) for x,y in zip([vc,vuc],[tmpv1,tmpv2])]

sc, suc = [],[]
tmp1,tmp2 = 0,0
for i in range(n):
    sc.append(vc[i] - lx[i])
    suc.append(vuc[i] - (c - lx[n-1-i]))

ans = 0

s3,s4 = 0,0

for i in range(n):
    s1 = sc[i]
    s2 = suc[i]
    tmpv,tmpx,s3 = 0,0,0
    for j in range(n-1-i):
        s3 = max(s1 + suc[j] - min(lx[i],lux[j]),s3)
    ans = max(ans,s1,s2,s3)

print(ans)

# Optimized solution
n, c = list(map(int, input().split()))

lx, lv = [], []

for _ in range(n):
    tmpx, tmpv = list(map(int, input().split()))
    lx.append(tmpx)
    lv.append(tmpv)

lux = [c-x for x in reversed(lx)]

#両方向の累積和
tmpv1, tmpv2 = 0,0
vc, vuc = [],[]
for i in range(n):
    tmpv1 += lv[i]
    tmpv2 += lv[n-1-i]
    _ = [x.append(y) for x,y in zip([vc,vuc],[tmpv1,tmpv2])]

sc, suc = [],[]
tmp1,tmp2 = 0,0
for i in range(n):
    sc.append(vc[i] - lx[i])
    suc.append(vuc[i] - (c - lx[n-1-i]))

ssc,ssuc = [],[]
tmp,tmpu = -c, -c
for i in range(n):
    tmp = max(tmp, sc[i])
    tmpu = max(tmpu, suc[i])
    ssc.append(tmp)
    ssuc.append(tmpu)
ans = 0

for i in range(n):
    s1 = sc[i]
    s2 = suc[i]
    if i == n-1:
        s3,s4 = 0,0
    else:
        s3 = s1 - lx[i] + ssuc[max(0,n-i-2)]
        s4 = s2 - lux[i] + ssc[max(0,n-i-2)]

    ans = max(ans,s1,s2,s3,s4)

print(ans)
# Original solution
from itertools import accumulate
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
N, C = list(map(int, input().split()))

posDist = []
posVal = []
for _ in range(N):
    d, v = list(map(int, input().split()))
    posDist.append(d)
    posVal.append(v)

negDist = []
negVal = []
for d, v in zip(reversed(posDist), reversed(posVal)):
    negDist.append(C-d)
    negVal.append(v)


posDist = [0]+posDist
negDist = [0]+negDist

posVal = [0]+list(accumulate(posVal))
negVal = [0]+list(accumulate(negVal))
# print(posDist)
# print(negDist)
# print(posVal)
# print(negVal)
for i, d in enumerate(posDist):
    posVal[i] -= d
for i, d in enumerate(negDist):
    negVal[i] -= d
ans = 0

# print("after")
# print(posVal)
# print(negVal)
for l in range(N+1):
        if negVal[l] < 0:
            continue
        for r in range(N-l+1):
            tmp = posVal[r]+negVal[l]-min(posDist[r], negDist[l])
            #print("l,r->", l, r, tmp)
            ans = max(tmp, ans)
print(ans)


# Optimized solution
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
N, C = list(map(int, input().split()))
sushis = [list(map(int, input().split())) for _ in range(N)]

# Aを時計回り,Bを反時計回りとする
# O->Aと0->A->Oのコストを計算
valA = []
valArev = []
sumV = 0
tmpMax = -float('inf')

for d, v in sushis:
    sumV += v
    valArev.append(sumV-2*d)
    tmpMax = max(tmpMax, sumV-d)
    valA.append(tmpMax)

valB = []
valBrev = []
sumV = 0
tmpMax = -float('inf')
for d, v in reversed(sushis):
    sumV += v
    revD = C-d
    valBrev.append(sumV-2*revD)
    tmpMax = max(tmpMax, sumV-revD)
    valB.append(tmpMax)


# 折り返しなしの場合の値
ans = max(valA+valB+[0])
# O->A->O->B
for i in range(N-1):
    ans = max(ans, valArev[i]+valB[N-i-2])

# O->B->O->A
for i in range(N-1):
    ans = max(ans, valBrev[i]+valA[N-i-2])
print(ans)
# Original solution
N,C=list(map(int, input().split()))
#Aは時計回り
A,B=[],[]
allv=0
for i in range(N):
  a,b=list(map(int, input().split()))
  A.append([a,b])
  B.append([C-a,b])
  allv+=b
A,B=sorted(A),sorted(B)
OA,OB,AS,BS=[],[],[],[]
ax,av,bx,bv=0,0,0,0
for i in range(N):
  ax,bx=A[i][0],B[i][0]
  av+=A[i][1]
  bv+=B[i][1]
  OA.append((ax,av))
  OB.append((bx,bv))
  AS.append(av-ax)
  BS.append(bv-bx)
#OA→AO→OBといくとき
ansa=0
for i in range(N-1):
  #iまで行く
  bma=N-i
  oa=OA[i][1]-OA[i][0]
  ao=-OA[i][0]
  ob=max(BS[:N-i-1])
  d=max(oa,oa+ao+ob)
  ansa=max(ansa,d)
ansb=0
for i in range(N-1):
  #iまで行く
  ama=N-i
  ob=OB[i][1]-OB[i][0]
  bo=-OB[i][0]
  oa=max(AS[:N-i-1])
  d=max(ob,ob+bo+oa)
  ansb=max(ansb,d)
print((max(ansa,ansb,allv-(C-max(OA[0][0],OB[0][0])))))

# Optimized solution
N,C=list(map(int, input().split()))
#Aは時計回り
A,B=[],[]
allv=0
for i in range(N):
  a,b=list(map(int, input().split()))
  A.append([a,b])
  B.append([C-a,b])
  allv+=b
A,B=sorted(A),sorted(B)
OA,OB,AS,BS=[],[],[],[]
ax,av,bx,bv=0,0,0,0
for i in range(N):
  ax,bx=A[i][0],B[i][0]
  av+=A[i][1]
  bv+=B[i][1]
  OA.append((ax,av))
  OB.append((bx,bv))
  AS.append(av-ax)
  BS.append(bv-bx)
#OA→AO→OBといくとき
d=BS[0]
e=AS[0]
BSma,ASma=[-10000]*N,[-10000]*N
for i in range(N):
  BSma[i]=max(d,BS[i])
  d=BSma[i]
  ASma[i]=max(e,AS[i])
  e=ASma[i]
  
ansa=0
for i in range(N-1):
  #iまで行く
  bma=N-i
  oa=OA[i][1]-OA[i][0]
  ao=-OA[i][0]
  ob=BSma[-2-i]
  d=max(oa,oa+ao+ob)
  ansa=max(ansa,d)
ansb=0
for i in range(N-1):
  #iまで行く
  ama=N-i
  ob=OB[i][1]-OB[i][0]
  bo=-OB[i][0]
  oa=ASma[-2-i]
  d=max(ob,ob+bo+oa)
  ansb=max(ansb,d)
print((max(ansa,ansb,allv-(C-max(OA[0][0],OB[0][0])))))
# Original solution
n, c = list(map(int, input().split()))
xv = [[int(x) for x in input().split()] for _ in range(n)]
n += 1
oa = [0] * n
ob = [0] * n
xv.insert(0, [0, 0])
maxcal = 0
for i in range(1,n):
    oa[i] = oa[i-1] + xv[i][1]
ob[n-1] = xv[i][1]
for i in reversed(list(range(0,n-1))):
    ob[i] = xv[i][1] + ob[i+1]
for i in range(n):
    for j in range(n):
        cal = oa[i]
        d = 0
        if i != j:
            cal += ob[j]
            d = xv[i][0] * 2 + (c - xv[j][0])
            d2 = xv[i][0] + (c - xv[j][0]) * 2
            d = min(d, d2)
        else:
            d = xv[i][0]
        if d < c:
            maxcal = max(maxcal, cal - d)
print(maxcal)


# Optimized solution
n, c = list(map(int, input().split()))
xv = [[int(x) for x in input().split()] for _ in range(n)]
xv.insert(0, [0, 0])
n += 1
oa = [0] * (n + 1)
ob = [0] * (n + 1)
maxr = [0] * (n + 1)
maxl = [0] * (n + 1)
for i in range(1, n):
    oa[i] = oa[i - 1] + xv[i][1]
    maxr[i] = max(maxr[i - 1], oa[i] - xv[i][0])
ob[n - 1] = xv[i][1]
for i in range(n - 1, -1, -1):
    ob[i] = xv[i][1] + ob[i + 1]
    maxl[i] = max(maxl[i + 1], ob[i] - (c - xv[i][0]))
cal1 = max(maxr[n-1], maxl[0])
cal2 = 0
cal3 = 0
for i in range(n):
    cal2 = max(cal2, oa[i] - 2 * xv[i][0] + maxl[i+1])
    cal3 = max(cal3, ob[i] - 2 * (c - xv[i][0]) + maxr[i-1])
print((max(cal1, cal2, cal3)))
# Original solution
n,c=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(n)]

rev=[None]*(n+1)
norm=[None]*(n+1)
rev[0]=(0,0)
norm[0]=(0,0)
ans=0

# normal rotation
for i in range(1,n+1):
    x,v=l[i-1]
    norm[i]=(x,v+norm[i-1][1])

# reverse rotation
for i in range(1,n+1)[::-1]:
    x,v=l[i-1]
    if i==n:
        rev[i]=(c-x,v)
    else:
        rev[i]=(c-x,v+rev[i+1][1])

for i in range(n+1):
    for j in range(n-i+1):
        cost=min(norm[i][0]+2*rev[-j][0],2*norm[i][0]+rev[-j][0])
        ans=max(ans,rev[-j][1]+norm[i][1]-cost)

print(ans)

# Optimized solution
n,c=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(n)]

rev=[None]*(n+1)
norm=[None]*(n+1)
revmax=[None]*(n+1)

rev[0]=(0,0)
revmax[0]=(0,0)
norm[0]=(0,0)
ans=0

# normal rotation
for i in range(1,n+1):
    x,v=l[i-1]
    norm[i]=(x,v+norm[i-1][1])

# reverse rotation
for i in range(1,n+1)[::-1]:
    x,v=l[i-1]
    if i==n:
        rev[i]=(c-x,v)
    else:
        rev[i]=(c-x,v+rev[i+1][1])

for i in range(1,n+1):
    revmax[-i]=(max(revmax[-i+1][0],rev[-i][1]-2*rev[-i][0]),max(revmax[-i+1][1],rev[-i][1]-rev[-i][0]))

for i in range(n+1):
    v1=norm[i][1]-norm[i][0]+revmax[i-n][0]
    v2=norm[i][1]-2*norm[i][0]+revmax[i-n][1]
    ans=max(ans,v1,v2)

print(ans)
# Original solution
N, C = [int(_) for _ in input().split()]
xv = [[int(_) for _ in input().split()] for i in range(N)]

def solve(N, C, xv):
    
    from itertools import accumulate

    xs = [0] + [_[0] for _ in xv] + [C]
    vs = [0] + [_[1] for _ in xv] + [0]
    xs_rev = [C - x for x in xs[::-1]]
    vs_rev = vs[::-1]

    ts = accumulate(vs)
    txs = [t - x for x, t in zip(xs, ts)]
    maxtxs = list(accumulate(txs, max))

    ts_rev = accumulate(vs_rev)
    txs_rev = [t - x for x, t in zip(xs_rev, ts_rev)]
    maxtxs_rev = list(accumulate(txs_rev, max))

    result = 0
    for i, tx in enumerate(txs_rev[:-1]):
        r = tx - xs_rev[i] + maxtxs[N - i]
        result = max(result, r)
    for i, tx in enumerate(txs[:-1]):
        r = tx - xs[i] + maxtxs_rev[N - i]
        result = max(result, r)

    return result

print((solve(N, C, xv)))


# Optimized solution
N, C = [int(_) for _ in input().split()]
xv = [[int(_) for _ in input().split()] for i in range(N)]

def solve(N, C, xv):
    
    from itertools import accumulate

    xs = [0] + [_[0] for _ in xv] + [C]
    vs = [0] + [_[1] for _ in xv] + [0]
    xs_rev = [C - x for x in xs[::-1]]
    vs_rev = vs[::-1]

    ts = accumulate(vs)
    txs = [t - x for x, t in zip(xs, ts)]
    maxtxs = list(accumulate(txs, max))

    ts_rev = accumulate(vs_rev)
    txs_rev = [t - x for x, t in zip(xs_rev, ts_rev)]
    maxtxs_rev = list(accumulate(txs_rev, max))

    return max(
        max(tx - xs_rev[i] + maxtxs[N - i] for i, tx in enumerate(txs_rev[:-1])),
        max(tx - xs[i] + maxtxs_rev[N - i] for i, tx in enumerate(txs[:-1]))
    )

print((solve(N, C, xv)))
# Original solution
N = int(eval(input()))
a = []

for i in range(N):
    a.append(int(eval(input())))


count = 0
Sosu = True

for i in range(0,N):
    Sosu = True
    for j in range(2,a[i]):
        if a[i] % j == 0:
            Sosu = False
            break
        else :
            pass
    if Sosu :
        count+=1
    else:
        pass


print(count)







# Optimized solution
N = int(eval(input()))
a = []

count = 0
for i in range(N):
    x=int(eval(input()))
    if x == 2:
        count+=1
    else:
        if pow(2, x-1,x ) == 1:
            count+=1
        else:
            pass

print(count)
# Original solution
import sys

def is_prime(x,y):
    while(y < x):
        if(x % y == 0):
            return 0
        y += 2
    return 1

a = ""
l = []
count = 0
for input in sys.stdin:
    a += input
l = (a.split())
b = int(l[0])
l = sorted(set(l[1:]))
for i in l:
    if(int(i) == 2):
        count += 1
    elif(int(i) > 2 and int(i) % 2 != 0 and is_prime(int(i),3) == 1):
        count += 1
print(count)


# Optimized solution
import sys

def is_prime(x):
    if(x <= 3 and x > 1):
        return True
    elif(x % 2 == 0 or x % 3 == 0 or x < 2):
        return False
    i = 5
    while(i * i <= x):
        if(x % i == 0 or x % (i + 2) == 0):
            return False
        i += 6
    return True

l = []
count = 0
for input in sys.stdin:
    l.append(int(input))
for data in range(1,len(l)):
    if(is_prime(l[data]) == True):
        count += 1
print(count)
# Original solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-


"""
input:
11
7
8
9
10
11
12
13
14
15
16
17

output:
4
"""

import sys
import math


def is_prime(x):
    if x == 2:
        return True
    elif x < 2 or not x % 2:
        return False

    i = 3
    x_sqrt = math.sqrt(x)
    while i <= x_sqrt:
        if not x % i:
            return False
        i += 2

    return True


def solve(_c_list):
    cnt = 0
    for ele in _c_list:
        if is_prime(ele):
            cnt += 1
    return cnt


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    c_num = int(_input[0])
    c_list = list(map(int, _input[1:]))
    ans = solve(c_list)
    print(ans)

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


"""
input:
11
7
8
9
10
11
12
13
14
15
16
17

output:
4
"""

import sys


def is_prime(x):
    if x == 2:
        return True
    elif x < 2 or not x % 2:
        return False

    return pow(2, x - 1, x) == 1


def solve(_c_list):
    cnt = 0
    for ele in _c_list:
        if is_prime(ele):
            cnt += 1
    return cnt


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    c_num = int(_input[0])
    c_list = list(map(int, _input[1:]))
    ans = solve(c_list)
    print(ans)
# Original solution
import math

def isPrime(x) :
    if x == 2 :
        return True

    if x < 2 or x % 2 == 0 :
        return False

    i = 3
    while i <= math.sqrt(x) :
        if x % i == 0 :
            return False
        i += 2

    return True


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

    count = 0
    for num in nums :
        if isPrime(num) :
            count += 1

    print(count)


if __name__ == '__main__' :
    main()

# Optimized solution
def is_prime(x) :
    if x == 2 :
        return True
    if x < 2 or x % 2 == 0 :
        return False

    return pow(2, x-1, x) == 1

def main() :
    n = int(eval(input()))
    nums = []
    for _ in range(n) :
        x = int(eval(input()))
        nums.append(x)

    count = 0
    for num in nums :
        if is_prime(num) :
            count += 1

    print(count)

if __name__ == '__main__' :
    main()
# Original solution
def is_prime(x):
    if x == 1:
        return False
    l = x ** 0.5
    n = 2
    while n <= l:
        if x % n == 0:
            return False
        n += 1
    return True

import sys

def solve():
    file_input = sys.stdin
    N = file_input.readline()
    cnt = 0
    for l in file_input:
        x = int(l)
        if is_prime(x):
            cnt += 1
    print(cnt)

solve()

# Optimized solution
def is_prime(x):
    if x == 1:
        return 0
    l = x ** 0.5
    n = 2
    while n <= l:
        if x % n == 0:
            return 0
        n += 1
    return 1

import sys

def solve():
    N = int(eval(input()))
    cnt = 0
    for i in range(N):
        cnt += is_prime(int(eval(input())))
    print(cnt)

solve()
# Original solution
def is_prime(x):
    if x == 2:
        return 1
    elif x % 2 == 0:
        return 0
    l = x ** 0.5
    for i in range(3, int(x ** 0.5) + 1, 2):
        if x % i == 0:
            return 0
    return 1

import sys

def solve():
    file_input = sys.stdin
    N = file_input.readline()
    cnt = 0
    for l in file_input:
        cnt += is_prime(int(l))
    print(cnt)

solve()

# Optimized solution
# Fermat's little theorem
def is_prime(x):
    if x == 2:
        return 1
    elif x % 2 == 0:
        return 0
    else:
        return pow(2, x - 1, x) == 1

import sys

def solve():
    file_input = sys.stdin
    N = file_input.readline()
    cnt = 0
    for n in map(int, file_input):
        cnt += is_prime(n)
    print(cnt)

solve()
# Original solution
n = int(eval(input()))

count = 0

for i in range(n):
  check = True
  
  key = int(eval(input()))

  for i in range(2,key):
    if key % i == 0:
      check = False
    
  if check:
    count += 1

print(count)


# Optimized solution
def isPrime(n):
    for i in range(2, n):
        if i * i > n:
            return 1
        if n % i == 0:
            return 0
    return 1
 
ans = 0
n = int(eval(input()))
for i in range(n):
    x = int(eval(input()))
    ans = ans + isPrime(x)
 
print(ans)
# Original solution
prime_numbers = [2]
def is_prime(n):
  if n in prime_numbers: return True
  if n > prime_numbers[-1]:
    for i in range(prime_numbers[-1] + 1, n):
      is_prime(i)

  for i in prime_numbers:
    if i ** 2 > n: break
    if n % i == 0: return False
  prime_numbers.append(n)
  return True

N = int(eval(input()))
count = 0
for i in range(N):
  x = int(eval(input()))
  if is_prime(x): count += 1
print(count)

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

count = 0
for i in range(int(eval(input()))):
  if is_prime(int(eval(input()))) : count += 1
print(count)
# Original solution
import math

def prime(n):
    for i in range(2, int(n/2)+1):
        if  n % i == 0:
            return False
    return True

num_prime = []
k = 0
while True:
    try:
        n = eval(input())
    except:
        break
    if prime(int(n)):
        if not int(n) in num_prime:
            k += 1
            num_prime.append(int(n))

print(k)

# Optimized solution
import math

def prime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if  n % i == 0:
            return False
    return True

num_prime = []
k = 0
while True:
    try:
        n = eval(input())
    except:
        break
    if prime(int(n)):
        if not int(n) in num_prime:
            k += 1
            num_prime.append(int(n))

print(k)
# Original solution
c=0
n=int(eval(input()))
for _ in range(n):
 x=int(eval(input()))
 for i in range(2,int(x**.5+1)):
  if x%i==0:c+=1;break
print((n-c))


# Optimized solution
c=0
n=int(eval(input()))
for _ in range(n):
 x=int(eval(input()))
 if x!=2 and x%2==0:c+=1;continue
 for i in range(3,int(x**.5+1),2):
  if x%i==0:c+=1;break
print((n-c))
# Original solution
c=0
for _ in[0]*int(eval(input())):
 x=int(eval(input()))
 if 2 in[x,pow(2,x,x)]:c+=1
print(c)


# Optimized solution
import sys
eval(input());c=0
for e in sys.stdin:
 x=int(e)
 if 2 in[x,pow(2,x,x)]:c+=1
print(c)
# Original solution
import sys
eval(input());c=0
for x in map(int,sys.stdin):
 if 2 in[x,pow(2,x,x)]:c+=1
print(c)


# Optimized solution
import sys
eval(input())
print((sum(2 in[x,pow(2,x,x)]for x in map(int,sys.stdin))))
# Original solution
import sys
eval(input())
def f():print((sum(2 in[x,pow(2,x,x)]for x in map(int,sys.stdin))))
f()


# Optimized solution
import sys
eval(input())
print((sum(2 in[x,pow(2,x,x)]for x in map(int,sys.stdin.readlines()))))
# Original solution
import sys
import math
def get_prime(m):
    a = [2]+[i for i in range(3,m+1,2)]
    end = int(math.sqrt(m))
    for i in range(3, end, 2):
        if (i in a):
            for j in range(i*2, m, i):
                if (j in a):
                    a.remove(j)
            
    return a
n = int(eval(input()))
a = []
for i in range(n):
    a.append(int(eval(input())))
primes = get_prime(max(a))
result = 0
for i in range(n):
    if a[i] in primes:
        result+=1
print(result)

# Optimized solution
import math
n = int(eval(input()))
cnt = 0
for i in range(n):
    num = int(eval(input()))
    flag = True
    for j in range(2, int(math.sqrt(num))+1):
        if num%j == 0:
            flag = False
            break
    if flag:
        cnt+=1
print(cnt)
# Original solution
import math

def is_prime(num):
    i = 2
    while i <= math.sqrt(num):
        if num % i == 0:
            return False
        i = i + 1
    return True

N = int(eval(input()))
cnt = 0
for i in range(0, N):
    n = int(eval(input()))
    if (is_prime(n)):
        cnt = cnt + 1
        
print(cnt)

# Optimized solution
def is_prime(num):
    i = 2
    while i*i <= num:
        if num % i == 0:
            return False
        i = i + 1
    return True

N = int(eval(input()))
cnt = 0
for i in range(0, N):
    n = int(eval(input()))
    if (is_prime(n)):
        cnt = cnt + 1
        
print(cnt)
# Original solution
def checker(x):
    for i in range(2,x//2+1):
        if x % i == 0:
            return False
    return True

cnt = 0
q = int(eval(input()))
for _ in range(q):
    v=int(eval(input()))
    if checker(v):
        cnt += 1
print(cnt)

# Optimized solution
def checker(x):
    if x == 2:
        return True
    if x < 2 or x % 2 == 0 :
        return False
    for i in range(2,int(x**0.5)+1):
        if x % i == 0 :
            return False
    return True

cnt=0
q=int(eval(input()))
for _ in range(q):
    v=int(eval(input()))
    if checker(v):
        cnt += 1
print(cnt)
# Original solution
import math

def prime_numbers(numbers):
    return list(map(is_prime, numbers)).count(True)


def is_prime(n):
    if (n == 2):
        return True
    elif (n % 2 == 0):
        return False
    else:
        for i in range(3, int(n / 2), 2):
            if n % i == 0:
                return False

    return True

if __name__ == '__main__':
    n = int(eval(input()))
    numbers = []
    for i in range(0, n):
        numbers.append(int(eval(input())))
    print((prime_numbers(numbers)))



# Optimized solution
import math

def prime_numbers(numbers):
    return list(map(is_prime, numbers)).count(True)


def is_prime(n):
    if (n == 2):
        return True
    elif (n % 2 == 0):
        return False
    else:
        i = 3
        while i <= math.sqrt(n):
            if n % i == 0:
                return False
            i += 2

    return True

if __name__ == '__main__':
    n = int(eval(input()))
    numbers = []
    for i in range(0, n):
        numbers.append(int(eval(input())))
    print((prime_numbers(numbers)))