eolymp
bolt
Try our new interface for solving problems
Problems

Evil & Odious

Evil & Odious

A non-negative integer is called evil if has an even number of ones in its binary representation. Similarly, a non-negative integer is called \textit{odious} if has an odd number of ones in its binary representation. Let us write down evil and odious numbers in ascending order. Let \textbf{E(n)} be the \textbf{n}-th evil number in this list. Similarly, let \textbf{O(n)} be the \textbf{n}-th odious number. Write a program to calculate the sum of n-th evil and odious numbers \textbf{E(n) + O(n)} given their index \textbf{n}. \InputFile The input file contains a single integer, \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{1000000}). \OutputFile The output file should contain a single integer, the sum \textbf{E(n)} + \textbf{O(n)}.
Time limit 1 second
Memory limit 64 MiB
Input example #1
1
Output example #1
1
Source 2013-2014 ACM Central Region of Russia Quarterfinal, Rybinsk 2013/10/17