#!/usr/bin/perl -w

use strict;

$_ = '(('.join(')+(', <>).'))';
s/\s//g;
1 while
	s/\((\d+)\)/$1/ ||
	s/(\([^\(\)]*?)(\d+)\+(\d+)([^\(\)]*\))/$1.($2+$3).$4/e ||
	s/(\([^\(\)]*?)(\d+)\*(\d+)([^\(\)]*\))/$1.($2*$3).$4/e;
print "sum=$_\n";
