S = list(input()) for i in range(len(S)): S[i] = int(S[i]) ans = 0 for i in range(1<> j & 1: num += now now = S[j+1] else: now *= 10 now += S[j+1] num += now prime = 1 for j in range(2,int(num**0.5)+1): if num%j == 0: prime = 0 break if num == 1: prime = 0 ans += prime print(ans)