#include <iostream>
#include <sstring>
#include <string>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int n;
char colon;
float f, ans=0.0;
string line;
while(getline(cin,line)){
istringstream s(line);
while(s>>n>>colon>>f)
if(n%2==0) ans-=f;
else ans+=f;
cout<<ans<<endl;
ans=0.0;
}
return 0;
}