#include <iostream>
#define xx for
#define xxx int
#define xxxx char
#define xxxxxx void
using namespace std;
xxxxxx xxxxx(xxxx **x,xxxx y,xxx *c){*c-=y-'0';}
xxx main(){xxx n=0;xxxx buf[21],*p=gets(buf);xx(xxx i;*p;++p){if(*p=='-'){xxxxx(&p,*++p,&n);continue;}n+=*p-'0';}cout << n;}

ポインタすらまだよく分からんのに適当に作ったら動いた