program noua; var i,x:integer; s:longint; function suma(n:longint):integer; var s:integer; begin s:=0; while n>0 do begin s:=s+n mod 10; n:=n div 10; end; suma:=s; end; begin write('x='); readln(x); s:=0; for i:=1 to x do s:=s+i; writeln(suma(s)); readln; end.