998_D. Roman Digits_28717
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 ≤ n ≤ 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).
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000;
const int inf = 0x7fffffff;
template <class T>
inline void read(T &x) {
  x = 0;
  int ne = 0;
  char c;
  while (!isdigit(c = getchar())) ne = c == '-';
  x = c - 48;
  while (isdigit(c = getchar())) x = (x << 3) + (x << 1) + c - 48;
  x = ne ? -x : x;
  return;
}
int f[13] = {0, 4, 10, 20, 35, 56, 83, 116, 155, 198, 244, 292, 341};
bool vis[10000005];
int ans = 0, n;
void dfs(int now, int cnt) {
  if (now == n + 1) {
    if (!vis[cnt]) {
      vis[cnt] = 1;
      ans++;
    }
    return;
  }
  for (register int i = 1; i <= 4; i++) {
    dfs(now + 1, cnt + f[i]);
  }
  return;
}
int main() {
  read(n);
  if (n <= 12)
    printf("%d\n", f[n]);
  else
    printf("%I64d\n", (long long)f[12] + (long long)(n - 12) * 49);
  return 0;
}

1
 2
 10
 111199
 1000
 10000
 11
 244
 1000000000
 14
 55
 2000
 116
 20
 6
 600000000
 198
 12
 999999999
 100
 83
 13
 8
 150
 4
 35
 709000900
 1200
 292
 9
 100000000
 3
 101232812
 5
 5000
 7
 500000000
 56
 9999999
 155
 134707
 1100
 17
 255
 1000000100
 89
 3891
 201
 22
 15
 753689004
 157
 33
 1517731607
 101
 52
 23
 36
 219
 54
 357895503
 41
 21
 16
 100001000
 89307055
 24
 3435
 733753181
 59
 4312251
 106
 28
 257068
 1110
 25
 203
 1000001100
 88
 5915
 268
 38
 344581682
 238
 29
 507921316
 001
 97
 47
 263
 80
 591333944
 19
 42
 110001000
 90283358
 4519
 762592880
 102
 2996787
 209
 119397
 0110
 18
 246
 1000001000
 72
 11188
 249
 65
 684857025
 362
 50

4
 10
 244
 5448504
 48753
 489753
 292
 11709
 48999999753
 439
 2448
 97753
 5437
 733
 83
 29399999753
 9455
 341
 48999999704
 4653
 3820
 390
 155
 7103
 35
 1468
 34741043853
 58553
 14061
 198
 4899999753
 20
 4960407541
 56
 244753
 116
 24499999753
 2497
 489999704
 7348
 6600396
 53653
 586
 12248
 49000004653
 4114
 190412
 9602
 831
 488
 36930760949
 7446
 1370
 74368848496
 4702
 2301
 880
 1517
 10484
 2399
 17536879400
 1762
 782
 537
 4900048753
 4376045448
 929
 168068
 35953905622
 2644
 211300052
 4947
 1125
 12596085
 54143
 978
 9700
 49000053653
 4065
 289588
 12885
 1615
 16884502171
 11415
 1174
 24888144237
 4
 4506
 2056
 12640
 3673
 28975363009
 684
 1811
 5390048753
 4423884295
 221184
 37367050873
 4751
 146842316
 9994
 5850206
 5143
 635
 11807
 49000048753
 3281
 547965
 11954
 2938
 33557993978
 17491
 2203
