#include <bits/stdc++.h>
using namespace std;
int main() {
  int y, b, r, maxorna = 0, y2, b2, r2, i, tot = 0, total[100];
  scanf("%d %d %d", &y, &b, &r);
  tot = y + b + r;
  total[0] = 0;
  for (y2 = 1, b2 = 2, r2 = 3, i = 1;
       total[i - 1] <= tot && (y2 <= y && b2 <= b && r2 <= r);
       y2++, b2++, r2++, i++) {
    total[i] = y2 + b2 + r2;
    maxorna = max(total[i], total[i - 1]);
  }
  printf("%d", maxorna);
  return 0;
}
