#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int eps = 1e-10;
const int mod = 1e9 + 7;
int da[10] = {0, 3, 2, 2, 2, 1, 1, 1};
int db[10] = {0, 2, 2, 1, 1, 1, 1, 0};
int dc[10] = {0, 2, 2, 2, 1, 1, 0, 0};
int aa[10] = {0, 0, 1, 1, 1, 2, 2, 2};
int bb[10] = {0, 0, 0, 1, 1, 1, 1, 2};
int cc[10] = {0, 0, 0, 0, 1, 1, 2, 2};
int a, b, c;
int main(void) {
  scanf("%d%d%d", &a, &b, &c);
  int mx1, mx2, mx3, mx;
  int ans = -1;
  for (int i = 1; i <= 7; i++) {
    int ta = a - da[i], tb = b - db[i], tc = c - dc[i];
    if (ta < 0 || tb < 0 || tc < 0) {
      ta = a + aa[i], tb = b + bb[i], tc = c + cc[i];
      if (ta == 0)
        mx1 = 0;
      else if (ta == 1)
        mx1 = 3;
      else if (ta == 2)
        mx1 = 6;
      else if (ta >= 3)
        mx1 = 7;
      if (tb == 0)
        mx2 = 1;
      else if (tb == 1)
        mx2 = 5;
      else if (tb >= 2)
        mx2 = 7;
      if (tc == 0)
        mx3 = 2;
      else if (tc == 1)
        mx3 = 4;
      else if (tc >= 2)
        mx3 = 7;
      mx = min(mx1, min(mx2, mx3));
      ans = max(ans, (mx - i) + 1);
    } else {
      int t = min(ta / 3, min(tb / 2, tc / 2));
      ta -= 3 * t, tb -= 2 * t, tc -= 2 * t;
      if (ta == 0)
        mx1 = 0;
      else if (ta == 1)
        mx1 = 3;
      else if (ta == 2)
        mx1 = 6;
      else if (ta >= 3)
        mx1 = 7;
      if (tb == 0)
        mx2 = 1;
      else if (tb == 1)
        mx2 = 5;
      else if (tb >= 2)
        mx2 = 7;
      if (tc == 0)
        mx3 = 2;
      else if (tc == 1)
        mx3 = 4;
      else if (tc >= 2)
        mx3 = 7;
      mx = min(mx1, min(mx2, mx3));
      ans = max(ans, mx + t * 7 + (7 - i + 1));
    }
  }
  printf("%d\n", ans);
  return 0;
}
