#include <iostream>
using namespace std;
int main(){
double a,b,c,d, sum = 0;
cin >> a >> b >> c >> d;
if(a < 0) sum += a;
if(b < 0) sum += b;
if(c < 0) sum += c;
if(d < 0) sum += d;
cout << sum;
}
#include <iostream>
using namespace std;
int main(){
double a,b,c,d, sum = 0;
cin >> a >> b >> c >> d;
if(a < 0) sum += a;
if(b < 0) sum += b;
if(c < 0) sum += c;
if(d < 0) sum += d;
cout << sum;
}