CF582C Superior Periodic Subarrays

Description

You are given an infinite periodic array $ a_{0},a_{1},...,a_{n-1},... $ with the period of length $ n $ . Formally, ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF582C/aa44e9dfb7106bc0c4afdc0035ceead70e7d91ec.png). A periodic subarray $ (l,s) $ ( $ 0

Input Format

The first line contains number $ n $ ( $ 1

Output Format

Print a single integer — the sought number of pairs.

Explanation/Hint

In the first sample the superior subarrays are (0, 1) and (3, 2). Subarray (0, 1) is superior, as $ a_{0}>=a_{0},a_{0}>=a_{1},a_{0}>=a_{2},a_{0}>=a_{3},a_{0}>=a_{0},... $ Subarray (3, 2) is superior $ a_{3}>=a_{3},a_{0}>=a_{0},a_{3}>=a_{1},a_{0}>=a_{2},a_{3}>=a_{3},... $ In the third sample any pair of $ (l,s) $ corresponds to a superior subarray as all the elements of an array are distinct.