uses crt;
var a : longint;
k:integer;
function DEC_BIN(x:longint ;k:integer):string;
const t:array [0..1] of char = ('0','1');
var res:string; d:0..1;
begin
k:=0;
res:='';
while (x<>0) do begin
d:=x mod 2; res:=t[d]+res;
x:=x div 2;
if t[d]='1' then
inc(k)
end;
DEC_BIN:=res;
writeln('k = ',k);
end;
begin
clrscr;
readln( a );
writeln( DEC_BIN(a,k) );
readln;
end.