#include <bits/stdc++.h>
int min(int a, int b) {
  if (a < b)
    return a;
  else
    return b;
}
int main() {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  printf("%d", (min(min(b + 1, c), min(a + 2, min(b + 1, c))) * 3) - 3);
  return 0;
}
