#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int INF = 0x3f3f3f3f;
const int maxn = 100;
int T, n, m;
int main() {
  int x, y, z;
  while (cin >> x >> y >> z) {
    x++;
    z--;
    if (y < x) {
      x = y;
    }
    if (z < x) {
      x = z;
    }
    cout << 3 * x << endl;
  }
  return 0;
}
