import itertools as iter import collections as coll import heapq as hq import bisect as bis from decimal import Decimal as dec from functools import cmp_to_key import math import sys #import pypyjit #pypyjit.set_param('max_unroll_recursion=-1') sys.setrecursionlimit(10 ** 6) inp = sys.stdin.readline input = lambda : inp().rstrip() getN = lambda : int(inp()) getNs = lambda : map(int, inp().split()) getList = lambda :list(map(int, inp().split())) getStrs = lambda n : [input() for _ in [0] * n] def yexit(): print("Yes"); exit(0) def nexit(): print("No"); exit(0) pi = 3.141592653589793 mod = 1000000007 MOD = 998244353 INF = 4611686018427387903 dx = [1, 0, -1, 0]; dy = [0, 1, 0, -1] #di = coll.defaultdict(int) def check(p): return (p * p - n * a * p - (n * b + 1) < 0) """ Main Code """ n = getN() ans = 0 for a, b in iter.permutations([*range(10)], 2): p_init = max(a, b) + 1 if not(check(p_init)): continue ok = p_init ng = 10 ** 9 + 1 while(ng - ok > 1): p = (ok + ng) >> 1 if(check(p)): ok = p else: ng = p ans += ok - p_init + 1 print(ans)