IT City company developing computer games invented a new way to reward its employees.…
- User
IT City company developing computer games invented a new way to reward its employees. After a new game release users start buying it actively, and the company tracks the number of sales with precision to each transaction. Every time when the next number of sales is divisible by all numbers from 2 to 10 every developer of this game gets a small bonus.
A game designer Petya knows that the company is just about to release a new game that was partly developed by him. On the basis of his experience he predicts that n people will buy the game during the first month. Now Petya wants to determine how many times he will get the bonus. Help him to know it. Input
The only line of the input contains one integer n (1 ≤ n ≤ 1018) — the prediction on the number of people who will buy the game.
Output
Output one integer showing how many numbers from 1 to n are divisible by all numbers from 2 to 10.
Examples
Input
3000
Output
1
Assistant
We need to count numbers from 1 to n that are divisible by all numbers from 2 to 10 inclusive. That means the number must be divisible by the least common multiple (LCM) of 2,3,4,5,6,7,8,9,10. Compute LCM:
Prime factors: 2 = 2 3 = 3 4 = 2^2 5 = 5 6 = 2 * 3 7 = 7 8 = 2^3 9 = 3^2 10 = 2 * 5
LCM takes highest powers: 2^3, 3^2, 5, 7.
So LCM = 8 * 9 * 5 * 7 = 89=72, 725=360, 360*7=2520.
So numbers divisible by all numbers 2..10 are exactly multiples of 2520.
Thus answer = floor(n / 2520).
Check: Example n=3000, floor(3000/2520) = 1 (since 2520 <=3000, 5040>3000). So output 1, matches.
Constraints n up to 10^18, division is fine.
So solution: read n, compute n // 2520, print.
We should also consider if n can be less than 2520, floor division yields 0.
Thus answer.
But need to make sure: "every time when the next number of sales is divisible by all numbers from 2 to 10" meaning each time the cumulative total reaches a number that is divisible by all numbers from 2 to 10. So yes.
Thus final solution. ```python import sys
def solve() -> None: data = sys.stdin.read().strip() if not data: return n = int(data) LCM = 2520 # lcm of numbers 2..10 result = n // LCM print(result)