{$U-}
module happy_tikets;

use system, iostd, math, putnum;

var
  A,B,C,D,E,F,N<0>;

{
sub putsn
  putword(A);
  putword(B);
  putword(C);
  putword(D);
  putword(E);
  putword(F);
  cr;
ret
}


sub main
  for A,B,C,D,E,F in 0..9 do
    if A+B+C == D+E+F then
      inc(@N);
      {putsn}
    fi
  next
  putword(N-1);
  putstring ' happy tikets'; cr;
ret

end

