Alice and Bob are decorating a Christmas Tree. 

Alice wants only $3$ types of ornaments to be used on the Christmas Tree: yellow, blue and red. They have $y$ yellow ornaments, $b$ blue ornaments and $r$ red ornaments.

In Bob's opinion, a Christmas Tree will be beautiful if:  the number of blue ornaments used is greater by exactly $1$ than the number of yellow ornaments, and  the number of red ornaments used is greater by exactly $1$ than the number of blue ornaments. 

That is, if they have $8$ yellow ornaments, $13$ blue ornaments and $9$ red ornaments, we can choose $4$ yellow, $5$ blue and $6$ red ornaments ($5=4+1$ and $6=5+1$).

Alice wants to choose as many ornaments as possible, but she also wants the Christmas Tree to be beautiful according to Bob's opinion.

In the example two paragraphs above, we would choose $7$ yellow, $8$ blue and $9$ red ornaments. If we do it, we will use $7+8+9=24$ ornaments. That is the maximum number.

Since Alice and Bob are busy with preparing food to the New Year's Eve, they are asking you to find out the maximum number of ornaments that can be used in their beautiful Christmas Tree! 

It is guaranteed that it is possible to choose at least $6$ ($1+2+3=6$) ornaments.


-----Input-----

The only line contains three integers $y$, $b$, $r$ ($1 \leq y \leq 100$, $2 \leq b \leq 100$, $3 \leq r \leq 100$) — the number of yellow, blue and red ornaments. 

It is guaranteed that it is possible to choose at least $6$ ($1+2+3=6$) ornaments.


-----Output-----

Print one number — the maximum number of ornaments that can be used. 


-----Examples-----
Input
8 13 9

Output
24
Input
13 3 6

Output
9


-----Note-----

In the first example, the answer is $7+8+9=24$.

In the second example, the answer is $2+3+4=9$.

Difficulty: interview

Starter code:

Solutions:
y,b,r=map(int,input().split())
m=min(y,b-1,r-2)
print(3*m+3)

def main():
    y, b, r = map(int, input().split())
    mn = min(r - 2, b - 1, y)
    if (mn < 0):
        print(0)
    else:
        print(mn * 3 + 3)

main()

a, b, c = map(int, input().split())
print(min(a, b - 1, c - 2) * 3 + 3)


import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline
mii=lambda:list(map(int,input().split()))

a,b,c=mii()
b-=1
c-=2
print(min(a,b,c)*3+3)


y, b, r = list(map(int, input().split()))
print(min(y, b - 1, r - 2) * 3 + 3)


y, b, r = list(map(int, input().split()))
k = min(y, b - 1, r - 2)
print(k * 3 + 3)


y, b, r = list(map(int, input().split()))
b -= 1
r -= 2
print(3 * min(y, b, r) + 3)



a, b, c = map(int, input().split())
x = min(a, b - 1, c - 2)
print(x + x + 1 + x + 2)

a, b, c = map(int, input().split())
ans = c
if b < ans - 1:
    ans = b + 1
if a < ans - 2:
    ans = a + 2
print(3 * ans - 3)

y, b, r = map(int, input().split())
res = 6
y -= 1
b -= 2
r -= 3
while y * b * r:
    res += 3
    y -= 1
    b -= 1
    r -= 1
print(res)

y,b,r = [int(x) for x in input().split()]

x = min(y,b-1,r-2)
print(3*x+3)

y,b,r = list(map(int,input().split()))
b_y = b-1
r_y = r-2
print((min(y,b_y,r_y)+1)*3)


def mi():
    return list(map(int, input().split()))
'''

'''
y,b,r = mi()
if b>=r:
    b = r-1
else:
    r = b+1
if y>=b:
    y = b-1
else:
    b = y+1
    r = b+1
print(y+r+b)


y,b,r=map(int,input().split())
b-=1
r-=2
print(min(y,b,r)*3+3)

from sys import stdin, stdout
from math import sin, tan, cos, pi, atan2, sqrt, acos, atan, factorial
from random import randint

a, b, c = map(int, stdin.readline().split())
ans = 0

for i in range(1, a + 1):
    if i + 1 <= b and i + 2 <= c:
        ans = i * 3 + 3

stdout.write(str(ans))

a = list(map(int, input().split()))
a[1] -= 1
a[2] -= 2
k = min(a)
print(3 * k + 3)

# = list(map(int, input().split()))
# = map(int, input().split())
a, b, c = list(map(int, input().split()))
ans = 0
for i in range(a + 1):
    if b >= i + 1 and c >= i + 2:
        ans = i * 3 + 3
print(ans)


a, b, c = list(map(int, input().split()))

use = min(a, b - 1, c - 2)
print(3 * use + 3)


y, b, r=list(map(int, input().split()))
x=min(y, b-1, r-2)
print(3*x+3)


a, b, c = [int(i) for i in input().split()]
print(min(a, b-1, c-2)*3+3)

y,b,r=list(map(int,input().split()))

x=min(y,b-1,r-2)

print(x*3+3)


y,b,r = list(map(int,input().split()))
if b > y+1:
    b = y+1
else:
    y = b-1
if r > b+1:
    r = b+1
else:
    b = r-1
    y = b-1
print(y+b+r)                


a, b, c = list(map(int, input().split()))
print(min(3 * a + 3, 3 * b, 3 * c - 3))


y, b, r = list(map(int, input().split()))
print(min(y + 1, b, r - 1) * 3)


def read():
    return int(input())


def readlist():
    return list(map(int, input().split()))


def readmap():
    return map(int, input().split())


y, b, r = readmap()

b -= 1
r -= 2

print(3 * min(y, b, r) + 3)