#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main(int argc, char** argv) {
int n;
char colon;
double d;
string line;
while(getline(cin, line))
{
istringstream in(line);
double ans=0.0;
while(in >> n >> colon >> d)
if(n%2==1) ans=ans+d;
else ans=ans-d;
cout<<ans<<endl;
}
return 0;
}