program summa(input, output);
var a:integer;
    b:boolean;
begin
  write('vvedite 4-x znachnoe chislo: ');
  read(a);
  b:=a mod 10+a div 10 mod 10=a div 100 mod 10+a div 1000;
  writeln(b)
end.