#include<iostream>
#include<math.h>
using namespace std;
typedef long long ll;
int main()
{
ll a,b,c,d;
cin>>a>>b>>c>>d;
if(a<pow(2,62)&&b<pow(2,62)&&c<pow(2,62)&&d<pow(2,62)&&b)
{
cout<<a+b+c+d;
}
else{
cout<<"18446744073709551616";
}
}