//Translator is written by Mys_C_K.
#include<bits/stdc++.h>
using namespace std;
#define ______________________________________________________________ else
#define _____________________________________________________________ struct
#define ____________________________________________________________ const
#define ___________________________________________________________ priority_queue
#define __________________________________________________________ unordered_map
#define _________________________________________________________ min
#define ________________________________________________________ inline
#define _______________________________________________________ return
#define ______________________________________________________ unsigned
#define _____________________________________________________ while
#define ____________________________________________________ if
#define ___________________________________________________ upper_bound
#define __________________________________________________ delete
#define _________________________________________________ memcpy
#define ________________________________________________ sizeof
#define _______________________________________________ queue
#define ______________________________________________ namespace
typedef long long _____________________________________________;
#define ____________________________________________ size
#define ___________________________________________ memset
#define __________________________________________ lower_bound
#define _________________________________________ printf
#define ________________________________________ iterator
typedef long double _______________________________________;
#define ______________________________________ erase
#define _____________________________________ vector
#define ____________________________________ max
#define ___________________________________ scanf
#define __________________________________ using
#define _________________________________ for
#define ________________________________ sort
#define _______________________________ end
#define ______________________________ cin
#define _____________________________ find
#define ____________________________ count
#define ___________________________ reverse
#define __________________________ static
#define _________________________ endl
#define ________________________ unique
#define _______________________ begin
#define ______________________ insert
#define _____________________ cout
#define ____________________ std
#define ___________________ int
#define __________________ char
#define _________________ swap
#define ________________ new
#define _______________ set
#define ______________ double
#define _____________ map
#define ____________ void
#define ___________ stack
#define ___ getchar()
#define ____(_______________________________________________________________,______________________________________________________________________,b) _________________________________(___________________ _______________________________________________________________=______________________________________________________________________;_______________________________________________________________<=b;_______________________________________________________________++)
#define _____(_______________________________________________________________,v) ____(_______________________________________________________________,0,(___________________)v.____________________________________________()-1)
#define ______ ______________
#define _______ push_back
#define ________ make_pair
#define _________ first
#define __________ second
__________________________________ ______________________________________________ ____________________;
typedef pair<___________________,___________________> _;
typedef _______________<___________________>::________________________________________ __;
________________________________________________________ ___________________ ________________________________________________________________()
{
	___________________ _________________________________________________________________,__________________________________________________________________;_____________________________________________________((__________________________________________________________________=___)<'0'||__________________________________________________________________>'9');
	_________________________________________________________________=__________________________________________________________________^'0';_____________________________________________________((__________________________________________________________________=___)>='0'&&__________________________________________________________________<='9')
		_________________________________________________________________=(_________________________________________________________________<<1)+(_________________________________________________________________<<3)+(__________________________________________________________________^'0');_______________________________________________________ _________________________________________________________________;
}
____________________________________________________________ ___________________ ___________________________________________________________________=100010;_____________________________________________ ____________________________________________________________________[___________________________________________________________________],_____________________________________________________________________[___________________________________________________________________];___________________ ______________________________________________________________________[___________________________________________________________________],_______________________________________________________________________[___________________________________________________________________],________________________________________________________________________[___________________________________________________________________];
________________________________________________________ _____________________________________________ _________________________________________________________________________(___________________ __________________________________________________________________________,___________________ ___________________________________________________________________________) { ____________________________________________________(__________________________________________________________________________>___________________________________________________________________________) _______________________________________________________ 0;_______________________________________________________ _____________________________________________________________________[___________________________________________________________________________]-_____________________________________________________________________[__________________________________________________________________________-1]; }
___________________ main()
{
	___________________ ____________________________________________________________________________=________________________________________________________________();______________________________________________________________________[1]=________________________________________________________________(),____________________________________________________________________[1]=______________________________________________________________________[1],_____________________________________________________________________[1]=______________________________________________________________________[1];
	_________________________________(___________________ _______________________________________________________________=1;_______________________________________________________________<____________________________________________________________________________;_______________________________________________________________++)
	{
		_____________________________________________________((_______________________________________________________________________[_______________________________________________________________]=___)!='+'&&_______________________________________________________________________[_______________________________________________________________]!='-');______________________________________________________________________[_______________________________________________________________+1]=________________________________________________________________();
		____________________________________________________(_______________________________________________________________________[_______________________________________________________________]=='+') ____________________________________________________________________[_______________________________________________________________+1]=____________________________________________________________________[_______________________________________________________________]+______________________________________________________________________[_______________________________________________________________+1];
		______________________________________________________________ ____________________________________________________________________[_______________________________________________________________+1]=____________________________________________________________________[_______________________________________________________________]-______________________________________________________________________[_______________________________________________________________+1];_____________________________________________________________________[_______________________________________________________________+1]=_____________________________________________________________________[_______________________________________________________________]+______________________________________________________________________[_______________________________________________________________+1];
	}
	________________________________________________________________________[____________________________________________________________________________]=____________________________________________________________________________;_____________________________________________ _____________________________________________________________________________=____________________________________________________________________[____________________________________________________________________________];_________________________________(___________________ _______________________________________________________________=____________________________________________________________________________-1;_______________________________________________________________;_______________________________________________________________--) ____________________________________________________(_______________________________________________________________________[_______________________________________________________________]=='+') ________________________________________________________________________[_______________________________________________________________]=________________________________________________________________________[_______________________________________________________________+1];______________________________________________________________ ________________________________________________________________________[_______________________________________________________________]=_______________________________________________________________;
	____(_______________________________________________________________,1,____________________________________________________________________________-1) ____________________________________________________(_______________________________________________________________________[_______________________________________________________________]=='-')
		_____________________________________________________________________________=____________________________________(_____________________________________________________________________________,____________________________________________________________________[_______________________________________________________________]-_________________________________________________________________________(_______________________________________________________________+1,________________________________________________________________________[_______________________________________________________________+1])+_____________________________________________________________________[____________________________________________________________________________]-_____________________________________________________________________[________________________________________________________________________[_______________________________________________________________+1]]);
	_______________________________________________________ !_________________________________________("%lld\n",_____________________________________________________________________________);
}

Measured memory_bytes: 2944