program armstrong;

var i,j : longint;
    db : longint;
    s : longint;

BEGIN
  db:=0;
  for i:=1 to 2009 do
   begin
    s:=0;
    j:=i;
    while j>0 do
     begin
      inc(s,(j mod 10)*(j mod 10)*(j mod 10));
      j:=(j div 10);
     end;
    if s=i
     then begin
      inc(db);
      writeln(i);
     end;
   end;
  writeln('Osszesen: ',db,' darab.');
END.