import sys
import math


data = int(sys.stdin.readline())

# 找到data以内的素数
key = int(math.sqrt(data)) + 1

zhishu = []
zhishu.append(2)
for i in range(3, data):
    flag = 0
    for j in range(2, i):
        if i % j == 0:
            flag = 1
            break
    if flag == 0:
        zhishu.append(i)


count = 0

for i in range(len(zhishu)):
    for j in range(i + 1, len(zhishu)):
        if zhishu[i] + zhishu[j] == data:
            count = count + 1


if int(data / 2) in zhishu:
    count = count + 1

print(count)