begin
var n := ReadInteger();
var a := ReadArrInteger(n);
var Sum := 0;
foreach var x in a do
var s := x.ToString;
if (s.Length = 3) and
(s[1] < s[2]) and
(s[1].ToDigit + s[2].ToDigit + s[3].ToDigit > 10)
then Sum += x
end;
Print(Sum)
end.
begin
var n := ReadInteger();
var a := ReadArrInteger(n);
var Sum := 0;
foreach var x in a do
begin
var s := x.ToString;
if (s.Length = 3) and
(s[1] < s[2]) and
(s[1].ToDigit + s[2].ToDigit + s[3].ToDigit > 10)
then Sum += x
end;
Print(Sum)
end.