#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int minm, cont = 3;
  b--;
  c -= 2;
  minm = min(a, min(b, c));
  cout << cont + (3 * minm) << endl;
}
