Python 3 + astorastor, 10171017 1007 bytes - (25 + 50 + 100) = Score: 842842 834
saved 10 bytes by removing ts
and changing p
edit: I am unable to test the ridiculously long integer (1234567891234567891234564789087414984894900000000) [hangs my computer] but from my knowledge, Python 3 supports arbritrarily long integers.
from ast import*
from astor import*
ts,nt,bo,m,d,a,s,n,p,ty=to_source,NodeTransformerty=NodeTransformer,BinOp,Mult,Div,Add,Sub,Num,parsemap,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(mapp(int,list("".join(mapp(str,range(1,z.n+1)))))))
print(tsto_source(S().visit(A().visit(M().visit(pparse(input()))))))