program pil_5_55(input,output);
var
	x, s, i, t : integer;
begin
	write('Input x : ');
	read(x);
  s := 1;
  for i:=2 to trunc(sqrt(x)) do
  	if (x mod i) = 0 then begin
      t := x div i;
      s := s + i;
    	if i <> t then s:= s + t;
    end;
	if s=x then writeln(x, ' is perfect!')
  else writeln(x ,' isn''t perfect...');
end.