#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops")
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int a, b, c;
  cin >> a >> b >> c;
  for (int(i) = (100); (i) >= (1); --(i)) {
    if (a >= i && b >= i + 1 && c >= i + 2) {
      cout << 3 * i + 3 << endl;
      return 0;
    }
  }
  return 0;
}
