Let's introduce a number system which is based on a roman digits. There are digits I, V, X, L which correspond to the numbers $1$, $5$, $10$ and $50$ respectively. The use of other roman digits is not allowed.

Numbers in this system are written as a sequence of one or more digits. We define the value of the sequence simply as the sum of digits in it.

For example, the number XXXV evaluates to $35$ and the number IXI — to $12$.

Pay attention to the difference to the traditional roman system — in our system any sequence of digits is valid, moreover the order of digits doesn't matter, for example IX means $11$, not $9$.

One can notice that this system is ambiguous, and some numbers can be written in many different ways. Your goal is to determine how many distinct integers can be represented by exactly $n$ roman digits I, V, X, L.


-----Input-----

The only line of the input file contains a single integer $n$ ($1 \le n \le 10^9$) — the number of roman digits to use.


-----Output-----

Output a single integer — the number of distinct integers which can be represented using $n$ roman digits exactly.


-----Examples-----
Input
1

Output
4

Input
2

Output
10

Input
10

Output
244



-----Note-----

In the first sample there are exactly $4$ integers which can be represented — I, V, X and L.

In the second sample it is possible to represent integers $2$ (II), $6$ (VI), $10$ (VV), $11$ (XI), $15$ (XV), $20$ (XX), $51$ (IL), $55$ (VL), $60$ (XL) and $100$ (LL).

Difficulty: competition

Starter code:

Solutions:

# add 0,4,9,49
# this is a stupid solution

import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline

n=int(input())

# do a stupid approach
dp=[0]*150
s=set([0])
for i in range(150):
    dp[i]=len(s)
    s2=set(s)
    for j in s:
        s2.add(j+4)
        s2.add(j+9)
        s2.add(j+49)
    s=s2

if 0:
    for i in range(100):
        if dp[i+49]-dp[i]!=2401:
            print(i)

if n<150: print(dp[n])
else:
    stuff=(n//49)
    while n-stuff*49+49<150: stuff-=1
    print(dp[n-stuff*49]+2401*stuff)

#
#           _____                    _____                    _____          
#          /\    \                  /\    \                  /\    \         
#         /::\____\                /::\    \                /::\____\        
#        /:::/    /               /::::\    \              /:::/    /        
#       /:::/    /               /::::::\    \            /:::/    /         
#      /:::/    /               /:::/\:::\    \          /:::/    /          
#     /:::/____/               /:::/__\:::\    \        /:::/____/           
#    /::::\    \               \:::\   \:::\    \      /::::\    \           
#   /::::::\    \   _____    ___\:::\   \:::\    \    /::::::\    \   _____  
#  /:::/\:::\    \ /\    \  /\   \:::\   \:::\    \  /:::/\:::\    \ /\    \ 
# /:::/  \:::\    /::\____\/::\   \:::\   \:::\____\/:::/  \:::\    /::\____\
# \::/    \:::\  /:::/    /\:::\   \:::\   \::/    /\::/    \:::\  /:::/    /
#  \/____/ \:::\/:::/    /  \:::\   \:::\   \/____/  \/____/ \:::\/:::/    / 
#           \::::::/    /    \:::\   \:::\    \               \::::::/    /  
#            \::::/    /      \:::\   \:::\____\               \::::/    /   
#            /:::/    /        \:::\  /:::/    /               /:::/    /    
#           /:::/    /          \:::\/:::/    /               /:::/    /     
#          /:::/    /            \::::::/    /               /:::/    /      
#         /:::/    /              \::::/    /               /:::/    /       
#         \::/    /                \::/    /                \::/    /        
#          \/____/                  \/____/                  \/____/         
#
a = [0,4,10,20,35,56,83,116,155,198,244,292]
n = int(input())
if n <= 11:
    print(a[n])
else:
    print(n*49-247)


from sys import stdin, stdout


def count(n):
    d = {}
    cnt = 0
    cur = 0
    
    for i in range(n + 1):
        for j in range(n - i + 1):
            for z in range(n - j - i + 1):
                v = i * 1 + j * 5 + z * 10 + (n - i - j - z) * 50
                
                if not v in d:
                    d[v] = 1
                    cur += 1
                else:
                    d[v] += 1
    
    return cur

n = int(stdin.readline())


if n >= 20:
    upp = count(20) + 49 * (n - 20)
else:
    upp = count(n)
print(upp)

import sys

n = int(input())

res = 0
for V in range (1, min (n, 8) + 1):
  for X in range (min (n - V, 4) + 1):
    res += n + 1 - V - X

for X in range (min (n, 8) + 1):
    res += n + 1 - X

print (res)

def f(n):
	return (n+3)*(n+2)*(n+1)//6;
n=int(input());
ans=f(n);
if n>=6:ans-=f(n-6);
if n>=9:ans-=f(n-9)*2;
if n>=10:ans+=f(n-10);
if n>=14:ans+=f(n-14);
print(ans);

import itertools

STC = [
	[0,4,0,5],
	[1,0,8,0],
	[1,0,0,5]]
def ch(N, K):
    ans = 1
    for k in range(K): ans *= (N-k)
    for k in range(K): ans //= (k+1)
    return ans

N = int(input())
ans = ch(N+3, 3)
sgn = -1
for s in range(1, len(STC)+1):
    for cb in itertools.combinations(STC, s):
        aq = [0,0,0,0]
        for c in cb:
            for i in range(4):
                aq[i] = max(aq[i], c[i])
        tot = sum(aq)
        if N >= tot:
            #print(aq,cb)
            ans += sgn * ch(N-tot+3, 3);
    sgn *= -1
print(ans)


n = int(input())

if n > 20:
  print(733+(n-20)*49)
else:
  s = set()
  for i in range(n+1):
    for v in range(n-i+1):
      for x in range(n-i-v+1):
        l = n-i-v-x
        s.add(i+5*v+10*x+50*l)
  print(len(s))


n = int(input().strip())

def C(n, r):
    c = 1
    for i in range(r):
        c = c * (n-i)
    for i in range(r):
        c = c // (i+1)
    return c

def calc(n, r):
    if n < 0: return 0
    return C(n+r-1, r-1)

ans = 0

# case 1: d = 0
for i in range(5):
    ans += calc(n-i, 2)

for i in range(4):
    ans += calc(n-i, 2)

for i in range(5):
    for j in range(4):
        ans -= calc(n-i-j, 1)

# case 2: d > 0
# a < 5, b < 8
for i in range(5):
    for j in range(8):
        ans += calc(n-i-j-1, 2)

print (ans)


a = [0,4,10,20,35,56,83,116,155,198,244,292]
n = int(input())
if n <= 11:
    print(a[n])
else:
    print(n*49-247)

n = int(input())
a = [0, 4, 10, 20, 35, 56, 83, 116, 155, 198, 244, 292]
print(max(49 * n - 247, a[n % 12]))


a=[0,4,10,20,35,56,83,116,155,198,244,292]
n=int(input())
if n<=11 : print(a[n])
else : print(n*49-247)


a=[0,4,10,20,35,56,83,116,155,198,244,292]
n=int(input())
if n<=11 : print(a[n])
else : print(n*49-247)


a=[0,4,10,20,35,56,83,116,155,198,244]
b=292
n=int(input())
if n<=10:
	print(a[n])
else:
	print(b+(n-11)*49)

a=[0,4,10,20,35,56,83,116,155,198,244]
n=int(input())
if n<=10:
	print(a[n])
else:
	print(49*n-247)

x=[0, 4, 10, 20, 35, 56, 83, 116, 155, 198, 244, 292]
n=int(input())
print(x[n] if n<=11 else 292+(n-11)*49)

n = int(input())

ans = 0
minv = [int(1e9)] * 200000

minv[0] = 0
for i in range(49):
    for j in range(49):
        minv[(4*i+9*j) % 49] = min(minv[(4*i+9*j) % 49], i+j)

for i in range(49):
    if n >= minv[i]:
        ans += n-minv[i]+1

print(ans)

n = int(input())

ans = 0
for i in range(9):
    for j in range(49):
        
        def check(y, x):
            for i in range(49):
                for j in range(9):
                    if i == x and j == y:
                        continue
                    t = (x - i) * 9 + (y - j) * 4 
                    if t >= 0 and t % 49 == 0:
                        return False  
            return True
        
        if n - i - j >= 0 and check(i, j):
            ans += n - i - j + 1
print(ans)

'''
li = []
for i in range(n + 1):
    for j in range(n - i + 1):
        for k in range(n - i - j + 1):
            l = n - i - j - k
            if not ((i * 50 + j * 10 + k * 5 + l) in li):
                li.append(i * 50 + j * 10 + k * 5 + l)
print(len(li))
'''


a=[0,4,10,20,35,56,83,116,155,198,244]
b=292
n=int(input())
if n<=10:
	print(a[n])
else:
	print(b+(n-11)*49)

n = int(input())
s = set()
x = [1 , 5 , 10 , 50]
l = list()

def dfs(a , b , c):
  if a == n :
    s.add(b)
    return 
  while c < len(x) :
    dfs(a + 1 , b + x[c] , c)
    c += 1


if n <= 10 :
  dfs(0 , 0 , 0)
  print(len(s))
  return
else :
  print(244  + 49 * (n - 10) - 1)  


                                               



def main():
    a, b, c, res, nxt = -1, -1, 0, [1], [True]
    while b - a < c - b:
        cur, nxt = nxt, [False] * (len(nxt) + 50)
        for p in 1, 5, 10, 50:
            for i, f in enumerate(cur):
                if f:
                    nxt[i + p] = True
        a, b, c = b, c, sum(nxt)
        res.append(c)
    n = int(input())
    print(res[n] if len(res) > n else c + (c - b) * (n - len(res) + 1))


def __starting_point():
    main()

__starting_point()

n = int(input())

if n > 20:
    print(733+(n-20)*49)
else:
    s = set()
    for i in range(n+1):
        for v in range(n-i+1):
            for x in range(n-i-v+1):
                l = n-i-v-x
                s.add(i+5*v+10*x+50*l)
    print(len(s))



def f(n):
  if n < 0:
    return 0
  val = ( (n+3) * (n+2) * (n+1) ) // 6
  return val

def g(n):
  return f(n) - f(n-6) - 2*f(n-9) + f(n-10) + f(n-14)

n = int(input())
print(g(n))


def c(n):
    
    ans = 0
    if n > 15:
        ans += (49 * (n - 15))
        n = 15
    l = set()
    for i in range(max(n+1,441)):
        for j in range(max(n-i+1,196)):
            for k in range(n-i-j+1):
                l.add(i*4+j*9+k*49)
    return ans + len(l)
n = int(input())
print(c(n))


n = int(input())
a=[0,4,10,20,35,56,83,116,155,198,244,292]
if (n < 12):
	print(a[n])
else:
	print(292+(n-11)*49)