#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int i = b + 1 + b + b - 1;
  int j = c + c - 1 + c - 2;
  int k = a + a + 1 + a + 2;
  cout << min(i, min(j, k)) << endl;
  return 0;
}
