灯泡

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

V_Dragon有n栈电灯泡,编号为1-n,每个灯泡都有一个开关。那么问题来了

所有灯泡初始时为不亮的 V_Dragon分别进行三次操作 每次操作他都选一个质数x,将编号为x和x的整数倍的灯泡的开关都拨动一下(如果灯为亮,那么拨动以后灯为不亮,如果灯不亮,拨动以后变为亮)

求最后亮着的灯的数量

Format

Input

第一行一个n表示灯泡个数(1<=n<=10^9)

第二行三个数a,b,c表示V_Dragon每次选择的数(1<=a,b,c<=10^6)(a,b,c全为质数且a,b,c两两互不相等)

Output

数组最后亮着的灯的个数

Samples

30
2 3 5
15

Limitation

1s, 1024KiB for each test case.

第七届SWPU-ACM新生预选赛

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
103
Start at
2022-9-19 14:00
End at
2022-10-28 14:00
Duration
936 hour(s)
Host
Partic.
58