#SP0000060. Sàng của Alice (Alice Sieve)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Sàng của Alice (Alice Sieve)
Alice Sieve
Source: SPOJ
Version: Phuoc Hung OJ Extended
Problem Statement
Alice writes the integers from down to , initially all unmarked. She chooses the largest unmarked number as (initially ) and marks every proper positive divisor of present in the list, excluding itself. She then chooses the largest unmarked number smaller than and repeats. The process ends when no next number can be selected. Count the integers in that remain unmarked.
Input
One line contains integer .
Output
Print one integer: how many numbers remain unmarked after the process finishes.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
5
Output
3
Explanation
Initially the list is . For , no proper divisor lies in . Next marks , its proper divisor. Then marks nothing further. The unmarked numbers are , giving the answer 3.