program pil_3_29_c(input,output);
var
  number : integer;
  s1, s2 : integer;
  result : boolean;
begin
  write('Input number : ');
  read(number);
  s1 := number mod 10;
  number := number div 10;
  s1 := s1 + (number mod 10);
  number := number div 10;
  s2 := number mod 10;
  number := number div 10;
  s2 := s2 + (number mod 10);

  result := s1 = s2;
  WriteLn(result);
end.
