#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
int line=0;
while(getline(cin,s))
{
stringstream ss(s);
string a,c;
int x;
double y;
//vector<int> v2;
double n=0;
while(ss>>a)
{
//cout<<a<<" ";
int i=0;
while(a[i]!=':') c+=a[i],i++;
//cout<<c<<endl;
stringstream s2(c);
s2>>x;
//cout<<x<<" ";
c.clear();
for(;i<a.length();i++) c+=a[i];
s2.clear();
s2<<c;
s2>>y;
if(x%2==1) n+=y;
else n-=y;
// cout<<n<<" "<<m<<endl;
c.clear();
s2.clear();
}
cout<<n<<endl;
}
}