#include <iostream>
#include <cmath>
using namespace std;

int a[3];



int main() {
	bool flag = false;
	int store;
	int i = 3;
	int sum;
	int ans;
	int num;
	
	cin >> num;

	while (num > 0) {

		a[i] = (num % 10);
		num = (num / 10);

		i--;
	}

	
	while (flag == false) {
		flag = true;
		for (int j = 1; j < 3; j++) {

			if (a[j] > a[j + 1]) {
				store = a[j + 1];
				a[j + 1] = a[j];
				a[j] = store;

				flag = false;
			}

		}


	}
	sum = (a[3] * 10 + a[2]);
	ans = a[1] + sum;

	
		cout << ans;
	
	return 0;

}