#include
using namespace std;
int main() {
string a, b, c, d, ans;
int x, y, z = 0;
cin >> a >> b >> c >> d;
int maxSize = max(max(a.size(), b.size()), max(c.size(), d.size()));
ans.resize(maxSize + 1, '0');
for (int i = 1; i <= maxSize; i++) {
if (i > a.size()) x = 0;
else x = a[a.size() - i] - '0';
if (i > c.size()) y = 0;
else y = c[c.size() - i] - '0';
ans[maxSize + 1 - i] = (x + y + z) % 10 + '0';
z = (x + y + z) / 10;
}
if (z > 0) {
ans[0] = z + '0';
}
cout << ans << endl;
return 0;
}