{"raw_statement":[{"iden":"statement","content":"Imp is in a magic forest, where xorangles grow (wut?)\n\n<center>![image](https://espresso.codeforces.com/41a89e297f110aa906c319b9c9c581669469c1f7.png)</center>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.\n\nFormally, for a given integer _n_ you have to find the number of such triples (_a_, _b_, _c_), that:\n\n*   1 ≤ _a_ ≤ _b_ ≤ _c_ ≤ _n_;\n*   , where denotes the [bitwise xor](https://en.wikipedia.org/wiki/Bitwise_operation#XOR) of integers _x_ and _y_.\n*   (_a_, _b_, _c_) form a non-degenerate (with strictly positive area) triangle."},{"iden":"input","content":"The only line contains a single integer _n_ (1 ≤ _n_ ≤ 2500)."},{"iden":"output","content":"Print the number of xorangles of order _n_."},{"iden":"examples","content":"Input\n\n6\n\nOutput\n\n1\n\nInput\n\n10\n\nOutput\n\n2"},{"iden":"note","content":"The only xorangle in the first sample is (3, 5, 6)."}],"translated_statement":[{"iden":"statement","content":"Imp 在一个魔法森林中，那里生长着 xorangles（什么？）\n\n一个阶为 #cf_span[n] 的 xorangle 是指一个非退化三角形，其三边长度为不超过 #cf_span[n] 的整数，且三边长度的交错和等于零。Imp 需要计算阶为 #cf_span[n] 的不同 xorangle 的数量，才能走出这片森林。\n\n形式化地，给定整数 #cf_span[n]，你需要找出满足以下条件的三元组 #cf_span[(a, b, c)] 的数量：\n\n输入仅包含一行，一个整数 #cf_span[n] #cf_span[(1 ≤ n ≤ 2500)]。\n\n请输出阶为 #cf_span[n] 的 xorangle 的数量。\n\n第一个样例中唯一的 xorangle 是 #cf_span[(3, 5, 6)]。\n\n"},{"iden":"input","content":"输入仅包含一行，一个整数 #cf_span[n] #cf_span[(1 ≤ n ≤ 2500)]。"},{"iden":"output","content":"请输出阶为 #cf_span[n] 的 xorangle 的数量。"},{"iden":"examples","content":"输入\n6\n输出\n1\n输入\n10\n输出\n2"},{"iden":"note","content":"第一个样例中唯一的 xorangle 是 #cf_span[(3, 5, 6)]。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ with $ 1 \\leq n \\leq 2500 $.  \nA *xorangle of order $ n $* is a triple $ (a, b, c) \\in \\mathbb{Z}^3 $ such that:  \n- $ 1 \\leq a \\leq b \\leq c \\leq n $,  \n- $ a \\oplus b \\oplus c = 0 $,  \n- $ a + b > c $ (non-degenerate triangle condition).  \n\n**Constraints**  \n$ 1 \\leq n \\leq 2500 $\n\n**Objective**  \nCount the number of distinct triples $ (a, b, c) $ satisfying the above conditions.","simple_statement":null,"has_page_source":false}