CF922B Magic Forest

Description

Imp is in a magic forest, where xorangles grow (wut?) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF922B/eea79d64d5bc09a90f356e81b9be908191dfc1cd.png)A xorangle of order $ n $ is such a non-degenerate triangle, that lengths of its sides are integers not exceeding $ n $ , and the xor-sum of the lengths is equal to zero. Imp has to count the number of distinct xorangles of order $ n $ to get out of the forest. Formally, for a given integer $ n $ you have to find the number of such triples $ (a,b,c) $ , that: - $ 1

Input Format

The only line contains a single integer $ n $ $ (1

Output Format

Print the number of xorangles of order $ n $ .

Explanation/Hint

The only xorangle in the first sample is $ (3,5,6) $ .