i = int(input())
if i < 1e3 : print(i)
elif 1e3 <= i < 1e4 : print(str(round(i/1e3,1))+'K')
elif 1e4 <= i < 1e5 : print(str(int(round(i/1e5,2)*1e2))+'K')
elif 1e5 <= i < 1e6 : print(str(int(round(i/1e6,3)*1e3))+'K')
elif 1e6 <= i < 1e7 : print(str(round(i/1e6,1))+'M')
elif 1e7 <= i < 1e8 : print(str(int(round(i/1e8,2)*1e2))+'M')
elif 1e8 <= i < 1e9 : print(str(int(round(i/1e9,3)*1e3))+'M')
elif 1e9 <= i < 1e10 : print(str(round(i/1e9,1))+'B')
elif 1e10 <= i < 1e11 : print(str(int(round(i/1e11,2)*1e2))+'B')
elif 1e11 <= i : print(str(int(round(i/1e12,3)*1e3))+'B')