Under construction

Still being built. Things may change

Two Formats

Time limit2sMemory limit1024 MB

Summary
Given N as read on a little-endian device after a big-endian transfer, recover the original number M by reversing its three bytes.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Statement

A byte is a unit of information made of eight binary digits. One byte can therefore hold the 282^8 integers from 00 to 255255. To store larger numbers, a computer uses several bytes. The number is written in base 256256, and its digits are stored in the bytes. That is, to store A=∑i=0k256i⋅AiA = \sum_{i=0}^{k} 256^i \cdot A_i (0≤Ai≤2550 \le A_i \le 255), (k+1)(k+1) bytes holding A0,A1,…,AkA_0, A_1, \ldots, A_k are used. For example, storing 20000002000000 takes 3 bytes: 2000000=128⋅2560+132⋅2561+30⋅25622000000 = 128 \cdot 256^0 + 132 \cdot 256^1 + 30 \cdot 256^2, so the bytes hold 128128, 132132, and 3030.

Devices differ in the order in which they store the bytes of one number. The two most common orders are big-endian and little-endian. Big-endian stores the bytes from the most significant digit to the least, in the order Ak,Ak−1,…,A1,A0A_k, A_{k-1}, \ldots, A_1, A_0. For 20000002000000, this order is 30,132,12830, 132, 128. Little-endian is the reverse of big-endian.

Now suppose a number is sent from a big-endian device to a little-endian device. The receiving device reads the bytes in its own order, so it may read a completely different number. For example, sending 20000002000000 transmits the bytes 30,132,12830, 132, 128. The receiver reads them as 30⋅2560+132⋅2561+128⋅2562=842243030 \cdot 256^0 + 132 \cdot 256^1 + 128 \cdot 256^2 = 8422430.

You are given the number NN recorded on the little-endian device after the number MM was received from the big-endian device. Recover MM.

Input

The first line contains one integer NN (1≤N<2241 \le N < 2^{24}).

Output

Print the number MM.

Examples2

  1. Example 1

    Input
    8422430
    
    Expected output
    2000000
    
  2. Example 2

    Input
    257
    
    Expected output
    257