#include <bits/stdc++.h>
using namespace std;
int main() {
  char x[20], y[20], z[20], sum1[20], sum2[20], s1[20], s2[20], s3[20], s4[20];
  int l1, l2, l3, i, j, m, n, d1, d2, d3, temp, t, k;
  while (cin >> x >> y >> z) {
    l1 = strlen(x);
    l2 = strlen(y);
    l3 = strlen(z);
    m = max(l1, l2);
    m = max(m, l3);
    n = m - l1;
    for (i = 0; i < n; i++) s1[i] = 48;
    for (i = 0; i < l1; i++) s1[n++] = x[i];
    s1[n] = '\0';
    n = m - l2;
    for (i = 0; i < n; i++) s2[i] = 48;
    for (i = 0; i < l2; i++) s2[n++] = y[i];
    s2[n] = '\0';
    n = m - l3;
    for (i = 0; i < n; i++) s3[i] = 48;
    for (i = 0; i < l3; i++) s3[n++] = z[i];
    s3[n] = '\0';
    if (strcmp(s1, s2) > 0 && strcmp(s2, s3) > 0) {
      strcpy(s4, s1);
      strcpy(s1, s2);
      strcpy(s2, s4);
      strcpy(s4, s2);
      strcpy(s2, s3);
      strcpy(s3, s4);
    } else if (strcmp(s1, s2) < 0 && strcmp(s2, s3) > 0) {
      strcpy(s4, s2);
      strcpy(s2, s3);
      strcpy(s3, s4);
      if (strcmp(s1, s3) > 0) {
        strcpy(s4, s1);
        strcpy(s1, s3);
        strcpy(s3, s4);
      }
    } else if (strcmp(s1, s2) > 0 && strcmp(s2, s3) < 0) {
      strcpy(s4, s1);
      strcpy(s1, s2);
      strcpy(s2, s4);
      if (strcmp(s2, s3) > 0) {
        strcpy(s4, s2);
        strcpy(s2, s3);
        strcpy(s3, s4);
      }
    }
    temp = 0;
    j = 0;
    for (i = m - 1; i >= 0; i--) {
      d1 = s1[i] - 48;
      d2 = s2[i] - 48;
      temp += 2 * d1 + 2 * d2;
      if (temp > 9) {
        t = temp % 10;
        temp = temp / 10;
      } else {
        t = temp;
        temp = 0;
      }
      sum1[j++] = t + 48;
    }
    while (temp != 0) {
      sum1[j++] = temp % 10 + 48;
      temp /= 10;
    }
    sum1[j] = '\0';
    k = 0;
    for (i = j - 1; i >= 0; i--) x[k++] = sum1[i];
    x[k] = '\0';
    temp = 0;
    j = 0;
    for (i = m - 1; i >= 0; i--) {
      d1 = s1[i] - 48;
      d2 = s2[i] - 48;
      d3 = s3[i] - 48;
      temp += d1 + d2 + d3;
      if (temp > 9) {
        t = temp % 10;
        temp = temp / 10;
      } else {
        t = temp;
        temp = 0;
      }
      sum2[j++] = t + 48;
    }
    while (temp != 0) {
      sum2[j++] = temp % 10 + 48;
      temp /= 10;
    }
    sum2[j] = '\0';
    k = 0;
    for (i = j - 1; i >= 0; i--) y[k++] = sum2[i];
    y[k] = '\0';
    l1 = strlen(x);
    l2 = strlen(y);
    m = max(l1, l2);
    n = m - l1;
    for (i = 0; i < n; i++) s1[i] = 48;
    for (i = 0; i < l1; i++) s1[n++] = x[i];
    s1[n] = '\0';
    n = m - l2;
    for (i = 0; i < n; i++) s2[i] = '0';
    for (i = 0; i < l2; i++) s2[n++] = y[i];
    s2[n] = '\0';
    if (strcmp(s1, s2) < 0) {
      i = 0;
      while (s1[i] == '0') i++;
      for (; s1[i] != '\0'; i++) cout << s1[i];
      cout << endl;
    } else {
      i = 0;
      while (s2[i] == '0') i++;
      for (; s2[i] != '\0'; i++) cout << s2[i];
      cout << endl;
    }
  }
  return 0;
}
