PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000071. Số gần nguyên tố (Almost Prime)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Số gần nguyên tố (Almost Prime)
Almost Prime
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
A positive integer is almost prime if it has exactly two distinct prime divisors. For example, and each have the distinct prime divisors , whereas has one and has three. Given , count all almost prime integers in .
Input
One line contains the integer .
Output
Print how many almost prime integers are in .
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
10
Output
2
Explanation
In , the integer has prime divisors and has prime divisors . The numbers each have only one distinct prime divisor, and no other number has exactly two. Hence the answer is .