# Python 3, 1017 bytes - (25 + 50 + 100) = Score: 842 _edit: I am unable to test the ridiculously long integer (1234567891234567891234564789087414984894900000000) but from my knowledge, Python 3 supports arbritrarily long integers._ This implementation <del>uses</del> abuses AST. I wouldn't consider abusing AST as "eval or similar". from ast import* from astor import* ts,nt,bo,m,d,a,s,n,p,ty=to_source,NodeTransformer,BinOp,Mult,Div,Add,Sub,Num,parse,type class M(nt): def visit_BinOp(t,z): if ty(z.left)==bo and ty(z.right)==bo:return bo(t.visit_BinOp(z.left),z.op,t.visit_BinOp(z.right)) if ty(z.left)==bo:return bo(t.visit_BinOp(z.left),z.op,z.right) if ty(z.right)==bo:return bo(z.left,z.op,t.visit_BinOp(z.right)) if ty(z.op)==m:return n(z.left.n*z.right.n) if ty(z.op)==d:return n(z.left.n/z.right.n);return z class A(nt): def visit_BinOp(t,z): if ty(z.left)==bo and ty(z.right)==bo:return bo(t.visit_BinOp(z.left),z.op,t.visit_BinOp(z.right)) if ty(z.left)==bo:return bo(t.visit_BinOp(z.left),z.op,z.right) if ty(z.right)==bo:return bo(z.left,z.op,t.visit_BinOp(z.right)) if ty(z.op)==a:return n(z.left.n+z.right.n) if ty(z.op)==s:return n(z.left.n-z.right.n);return z class S(nt): def visit_Num(t,z):return n(sum(map(int,list("".join(map(str,range(1,z.n+1))))))) print(ts(S().visit(A().visit(M().visit(p(input())))))) Too lazy to write ungolfed, so I'll give you an explanation of the classes: M(NodeTransformer|nt) - converts multiplication and division into their results. A(NodeTransformer|nt) - converts addition and subtraction into their results. S(NodeTransformer|nt) - converts numbers into their sum of digits via the Pythonic (naïve) way. The last line just executes these classes in the appropriate order on the input, to preserve order of operations, and prevent unwanted behavior. Example usage ($ or > means user input) and by the way, the actual program takes input only once: $ python3 summer.py > 5 15 > 10 46 > 12 51 > 1000000 27000001 > 55*96-12 81393