program Project1;
var
  v,x,k,i,y:integer;
  z:real;
  d:array[1..3] of integer;
begin
  readln(v);
  d[1]:=1;
  d[2]:=2;
  d[3]:=5;
  X:=0;
  z:=0;
  while z<v do
begin
  for k:=1 to 10000 do
  begin
  y:=10*k;
  for i:=1 to 3 do
  z:=d[i]*y;
  end;
   x:=x+1;
end;
  writeln(x);
  readln;
end.