#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  while (cin >> a >> b >> c) {
    if (b >= c) {
      b = c - 1;
    } else {
      c = b + 1;
    }
    if (a >= b) {
      a = b - 1;
      cout << a + b + c << endl;
    } else {
      b = a + 1;
      c = a + 2;
      cout << a + b + c << endl;
    }
  }
}
