Campfire Riddle

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

One day Yurik found himself in a forest near the campfire where nn people had gathered.

It turned out that some of them are friends. Let's number all people with integers from 11 to nn. Let's denote the number of people that are friends with the ii-th person, as d_id\_i. It suddenly turned out that two people with numbers ii and jj (iji \ne j) are friends if and only if d_i=d_jd\_i = d\_j.

When Yurik came home he got curious, what is the minimum number of pairs of people that could be friends, so that the condition described above to be satisfied?

입력

The only line contains one integer nn (1n5,0001 \le n \le 5\\,000) --- the number of people.

출력

Print one integer --- the minimum number of pairs of friends.

힌트

Consider the first example. All possible cases are described below:

  1. Each two people are friends with each other. In this case the number of pairs of friends is 432=6\frac{4 \cdot 3}{2} = 6.
  2. Three people are pairwise friends with each other, and the fourth person is not friend with anyone. In this case the number of pairs of friends is 33.