#include<iostream> #include<iomanip> using namespace std; int main() { int T1, T2, T3, T4; cin >> T1 >> T2 >> T3 >> T4; cout << (T1 + T2 + T3 + T4) - 3 << endl; return 0; }