#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  while (a) {
    if (b >= a + 1 && c >= a + 2) {
      cout << (3 * a + 3) << endl;
      break;
    }
    a--;
  }
  return 0;
}
