#include <bits/stdc++.h>
const long long MOD = 1000000007;
const long long MAX = 1000010;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long a, b, c;
  long long s = 0;
  cin >> a >> b >> c;
  cout << 3 * (min(b, min(a + 1, c - 1)));
  return 0;
}
