Harryxun/stf_run huggingface dataset:
import sys
input = sys.stdin.readline

def main():
    X = int(input())

    i = 0
    while True:
        a = (X + i**5)**(1/5)
        if a.is_integer():
            print(str(int(a))+' '+str(i))
            break
        a = (X - i**5)**(1/5)
        if a.is_integer():
            print(str(int(a))+' '+str(-i))
            break
        i += 1

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    x = int(input())
    for i in range(-1000, 1000):
        for j in range(-1000, 1000):
            if x == i**5 - j**5:
                print(i, j)
                break
        else:
            continue
        break

if __name__ == '__main__':
    main()
from math import gcd
n,m = map(int,input().split())
a = list(map(lambda x: int(x)//2,input().split()))
def lcm(x,y):
    return x*y//gcd(x,y)
T = 1
for i in range(n):
    T = lcm(T,a[i])
ans=-(-(m//T)//2)
c=T
print(ans)

### FIXED CODE ###

from fractions import gcd
n,m = map(int,input().split())
a = list(map(lambda x: int(x)//2,input().split()))
def lcm(x,y):
    return x*y//gcd(x,y)
def f(x):
    cnt = 0
    while x%2 == 0:
        x //= 2
        cnt += 1
    return cnt
r = set([f(i) for i in a])
if len(r) != 1:
    print(0)
    exit()
T = 1
for i in range(n):
    T = lcm(T,a[i])
ans=-(-(m//T)//2)
c=T
print(ans)
n,m=map(int,input().split())
ac=[0 for _ in range(n)]
wt=[0 for _ in range(n)]
pen=0
for i in range(m):
    p,s=input().split()
    if s=="AC":
        ac.append(p)
        pen += wt[int(p)]
    else:
        if p in ac:
            pass
        else:
            wt[int(p)] += 1
            
t_ac=set(ac))
print(len(t_ac),pen)







### FIXED CODE ###

n,m=map(int,input().split())
AC=[0 for _ in range(n)]
WA=[0 for _ in range(n)]
pen=0
for _ in range(m):
    p,s=input().split()
    p=int(p)
    if s=="AC":
        if AC[p-1]==0:
            AC[p-1]=1
            pen += WA[p-1]
        else:
            pass
    else:
        if AC[p-1]==0:
            WA[p-1] +=1
        else:
            pass
print(AC.count(1),pen)
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
mod=10**9+7

s=input()
x,y=map(int,input().split())
lst=[[],[]]
cnt=0
tmp=0
for i in range(len(s)):
    if s[i]=="F":
        tmp+=1
    else:
        if cnt==0:
            x-=tmp
        else:
            lst[cnt%2].append(tmp)
        tmp=0
        cnt+=1
if tmp!=0:
    lst[cnt%2].append(tmp)
dpx=[[0]*16001 for i in range(len(lst[0])+1)]
dpy=[[0]*16001 for i in range(len(lst[1])+1)]
dpx[0][8000]=1
dpy[0][8000]=1

for i in range(len(lst[0])):
    for j in range(16001):
        if dpx[i][j]!=0:
            dpx[i+1][j+lst[0][i]]+=1
            dpx[i+1][j-lst[0][i]]+=1

for i in range(len(lst[1])):
    for j in range(16001):
        if dpy[i][j]!=0:
            dpy[i+1][j+lst[1][i]]+=1
            dpy[i+1][j-lst[1][i]]+=1

if dpx[len(lst[0])][8000+x]!=0 and dpy[len(lst[0])][8000+y]!=0:
    print("Yes")
else:
    print("No")
# print(x,lst)


### FIXED CODE ###

import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
mod=pow(10,9)+7

s=input()
x,y=map(int,input().split())
lst=[[],[]]
cnt=0
tmp=0
for i in range(len(s)):
    if s[i]=="F":
        tmp+=1
    else:
        if cnt==0:
            x-=tmp
        else:
            if tmp!=0:
                lst[cnt%2].append(tmp)
        tmp=0
        cnt+=1
if cnt==0:
    x-=tmp
elif tmp!=0:
    lst[cnt%2].append(tmp)

sumx=sum(lst[0])
sumy=sum(lst[1])
# print(x,sumx)
if sumx<x or x<-sumx:
    print("No")
    exit()
if sumy<y or y<-sumy:
    print("No")
    exit()
dpx=[[0]*(sumx*2+1) for i in range(len(lst[0])+1)]
dpy=[[0]*(sumy*2+1) for i in range(len(lst[1])+1)]
dpx[0][sumx]=1
dpy[0][sumy]=1

for i in range(len(lst[0])):
    for j in range(sumx*2+1):
        if dpx[i][j]!=0:
            dpx[i+1][j+lst[0][i]]+=1
            dpx[i+1][j-lst[0][i]]+=1

for i in range(len(lst[1])):
    for j in range(sumy*2+1):
        if dpy[i][j]!=0:
            dpy[i+1][j+lst[1][i]]+=1
            dpy[i+1][j-lst[1][i]]+=1

# print(dpx)
# print(dpy)
if dpx[len(lst[0])][sumx+x]!=0 and dpy[len(lst[1])][sumy+y]!=0:
    print("Yes")
else:
    print("No")
price = int(input())

top = price//4
for n in range(top+1):
  for m in range(top+1):
    if 4*n + 7*m == price:
      flag = 1
      break

if flag == 1:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

price = int(input())

flag = 0
top = price//4 + 1
for n in range(top+1):
  for m in range(top+1):
    if 4*n + 7*m == price:
      flag = 1
      break

if flag == 1:
  print('Yes')
else:
  print('No')
ii=lambda:map(int,raw_input().split())
n,k=ii()
T,F=True,False
e=[[] for _ in range(n)]
for _ in range(n-1):
    a,b=ii()
    e[a-1]+=[b-1];e[b-1]+=[a-1]
cost=[0]*n
ans=10**5
def dfs(x,f):
    if f>=0:vis[f]=T
    q=[(x,0)]
    while len(q):
        v,c=q.pop(0)
        if c>k/2:break
        cost[v]=c;vis[v]=T
        for w in e[v]:
            if not vis[w]:q+=[(w,c+1)]
    return n-vis.count(T)
if k%2:
    for i in range(n):
        for j in e[i]:
            if i<j:vis=[F]*n;dfs(i,j);ans=min(ans,dfs(j,i))
else:
    for i in range(n):vis=[F]*n;ans=min(ans,dfs(i,-1))
print ans


### FIXED CODE ###

n=int(raw_input())
a=map(int,raw_input().split())
a.sort()
print sum([a[2*i] for i in range(n)])
while True:
    x,y = map(int, input().split())
    if x == 0 and y == 0:
        break
    elif x <= y:
        print(x,y)
    else:
        print(y,x)

### FIXED CODE ###

i = 1
while True:
    x = int(input().strip())
    if x == 0:
        break
    else:
        print ("Case {}: {}".format(i,x))
        i += 1
print(input().replace(1,0).replace(9,1).replace(0,9))

### FIXED CODE ###

print(str(input()).replace('1','0').replace('9','1').replace('0','9'))
N = int(input())
A = list(map(int, input().split()))
r=1
for n in A:
    r=r*n
    if r==0:
        print(0)
    elif r>10**18:
        print(-1)
    else:
        print(r)

### FIXED CODE ###

A,B = map(int, input().split())
print(A*B)
n=int(input())
a=map(int,input().split())
d=[0]*n
for i in range(0,n):
  d[a[i]-1]=i+1
print(*d)  


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
d=[0]*n
for i in range(0,n):
  d[a[i]-1]=i+1
print(*d)
n = int(input())
s = 0

for i in range(n):
    a = list(input().split())
"""
a = [input().split() for i in range(n)]
"""
print(a)
l = [0]
r = [0]
for m in range(n):
    l.append(a[m])
    r.append(a[m+1])

print(l)
print(r)
for p in range(1,n+1):
    s += int(r[p])-int(l[p])+1

print(s)

### FIXED CODE ###

n = int(input())
s = 0
a = [input().split() for i in range(n)]

l = [0]
r = [0]
for m in range(n):
    l.append(a[m][0])
    r.append(a[m][1])

for p in range(1,n+1):
    s += int(r[p])-int(l[p])+1

print(s)
import numpy as np
from collections import Counter
H, W, M = map(int, input().split())
h = [0] * M
w = [0] * M
bom = np.zeros((H + 1, W + 1))
for i in range(M):
    h[i], w[i] = map(int, input().split())
    bom[h[i]][w[i]] = 1
hl = Counter(h)
hl = list(reversed(sorted(hl.items(), key=lambda x: x[1])))
wl = Counter(w)
wl = list(reversed(sorted(wl.items(), key=lambda x: x[1])))
ans = 0
#print(hl)
#print(wl)
max_hl = hl[0][1]
max_wl = wl[0][1]
ans = max_hl + max_wl
end_flag = 0
max_flag = 1
for i in range(len(hl)):
    for j in range(len(wl)):
        if hl[i][1] < max_hl:
            end_flag = 1
            break
        if wl[j][1] < max_wl:
            break
        if bom[hl[i][0]][wl[j][0]] == 1:
            continue
        else:
            end_flag = 1
            max_flag = 0
            break
    else:
        continue
    if end_flag == 1:
        break
print(ans - max_flag)


### FIXED CODE ###

from collections import Counter
H, W, M = map(int, input().split())
h = [0] * M
w = [0] * M
h_w = {}
for i in range(M):
    h[i], w[i] = map(int, input().split())
    h_w[(h[i], w[i])] = 1
hl = Counter(h)
hl = list(reversed(sorted(hl.items(), key=lambda x:x[1])))
wl = Counter(w)
wl = list(reversed(sorted(wl.items(), key=lambda x:x[1])))
ans = 0
#print(hl)
#print(wl)
max_hl = hl[0][1]
max_wl = wl[0][1]
ans = max_hl + max_wl
end_flag = 0
max_flag = 1
for i in range(len(hl)):
    for j in range(len(wl)):
        if hl[i][1] < max_hl:
            end_flag = 1
            break
        if wl[j][1] < max_wl:
            break
        if (hl[i][0], wl[j][0]) in h_w.keys():
            continue
        else:
            end_flag = 1
            max_flag = 0
            break
    else:
        continue
    if end_flag == 1:
        break
print(ans - max_flag)
#include <iostream>

using namespace std;

int main()
{
    long long n, k;
    cin >> n >> k;

    long long a = n / k, b = n / (k / 2) - a;
    long long c = a * a * a, d = b * b * b;
    if (k % 2 == 1)
        cout << c << endl;
    else
        cout << c + d << endl;
}


### FIXED CODE ###

def main():
    n, k = map(int, input().split())
    x = sum(2 * i % k == 0 for i in range(1, k))
    a, b = n // k, n % k
    y = sum(2 * i % k == 0 for i in range(k * a + 1, k * a + b + 1))
    c = x * a + y
    ans = (x * a + y) ** 3 + a ** 3
    print(ans)


if __name__ == '__main__':
    main()
print(len(re.sub("B+","B",re.sub("W+","W",input())))-1)


### FIXED CODE ###

candies=[int(x) for x in input().split()]
candies.sort()
if candies[2]==(candies[0]+candies[1]):
    print("Yes")
else:
    print("No")
args = raw_input()
 
if(args == "ABC"){
print("ARC")
}elif(args=="ARC"){
print("ABC")
}

### FIXED CODE ###

args = input()
if args == "ABC":
 print("ARC")
elif(args=="ARC"):
 print("ABC")
a,b = map(int,x.split())
if(a<b):
  print(0)
else:
  print(10)

### FIXED CODE ###

import numpy as np
x = input()
a,b = map(int,x.split())
if(a<b):
  print(0)
else:
  print(10)
import decimal
a,b = map(float,input().split())
print(decimal(a)*decimal(b))

### FIXED CODE ###

from decimal import Decimal
a,b = input().split()
print(int(Decimal(a)*Decimal(b)))
# -*- coding: utf-8 -*-
import sys
from collections import deque

N,M,P=map(int, sys.stdin.readline().split())

al=[ [] for i in range(N+1) ]		#隣接リスト
rev_al=[ [] for i in range(N+1) ]	#reverse隣接リスト
#辺のリスト
edge=[]

for i in range(M):
	a,b,c=map(int, sys.stdin.readline().split())
	al[a].append(b)
	rev_al[b].append(a)
	edge.append((a,b,c-P))


#ゴールからBFS
q=deque()
q.append(N)
#訪問した頂点
Visit=[ 0 for _ in range(N+1) ]
while q:
	fro=q.popleft()
	Visit[fro]=1
	for to in rev_al[fro]:
		if Visit[to]==0:
			q.append(to)
			
Visit1=Visit

#スタートからBFS
q=deque()
q.append(1)
#訪問した頂点
Visit=[ 0 for _ in range(N+1) ]
while q:
	fro=q.popleft()
	Visit[fro]=1
	for to in al[fro]:
		if Visit[to]==0:
			q.append(to)

Visit2=Visit

#1からもNからも到達可能な頂点の集合
V=[]
for v1,v2 in zip(Visit1,Visit2):
	V.append(v1&v2)

new_N=sum(V)

fedge=[]	#必要な要素だけをフィルターした辺集合
for a,b,c in edge:
	if V[a]==1 and V[b]==1:
		fedge.append((a,b,c))


D=[ float("-inf") for _ in range(N+1) ]	#頂点１からの距離 1-indexed
D[1]=0

#ベルマンフォード
for i in range(new_N):
	for a,b,c in fedge:
		if D[a]==float("-inf"): continue
		alt=D[a]+c
		if D[b]<alt:
			D[b]=alt
			if i==new_N-1:
				print -1
				quit()

print (max(0,D[N]))

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
from collections import deque

N,M,P=map(int, sys.stdin.readline().split())

al=[ [] for i in range(N+1) ]		#隣接リスト
rev_al=[ [] for i in range(N+1) ]	#reverse隣接リスト
#辺のリスト
edge=[]

for i in range(M):
	a,b,c=map(int, sys.stdin.readline().split())
	al[a].append(b)
	rev_al[b].append(a)
	edge.append((a,b,c-P))


#ゴールからBFS
#訪問した頂点
Visit=[ 0 for _ in range(N+1) ]
q=deque()
q.append(N)
Visit[N]=1
while q:
	fro=q.popleft()
	for to in rev_al[fro]:
		if Visit[to]==0:
			Visit[to]=1
			q.append(to)
			
Visit1=Visit

#スタートからBFS
#訪問した頂点
Visit=[ 0 for _ in range(N+1) ]
q=deque()
q.append(1)
Visit[1]=1
while q:
	fro=q.popleft()
	for to in al[fro]:
		if Visit[to]==0:
			Visit[to]=1
			q.append(to)

Visit2=Visit

#1からもNからも到達可能な頂点の集合
V=[]
for v1,v2 in zip(Visit1,Visit2):
	V.append(v1&v2)

new_N=sum(V)

fedge=[]	#必要な要素だけをフィルターした辺集合
for a,b,c in edge:
	if V[a]==1 and V[b]==1:
		fedge.append((a,b,c))


D=[ float("-inf") ]*(N+1)	#頂点１からの距離 1-indexed
D[1]=0

#ベルマンフォード
for i in range(new_N):
	for a,b,c in fedge:
		if D[a]==float("-inf"): continue
		alt=D[a]+c
		if D[b]<alt:
			D[b]=alt
			if i==new_N-1:
				print -1
				quit()

print max(0,D[N])
S = input()
K = int(input())
if len(S) > K:
  print(S[:K] + '...')
else:
  print(S)


### FIXED CODE ###

K = int(input())
S = input()
if len(S) > K:
  print(S[0:K] + '...')
else:
  print(S)
day = input()

if day == 'SUN :
    print(7)
elif day == 'MON' :
    print(6)
elif day == 'TUE' :
    print(5)
elif day == 'WED' :
    print(4)
elif day == 'THU' :
    print(3)
elif day == 'FRI' :
    print(2)
elif day == 'SAT' :
    print(1)

### FIXED CODE ###

day = input()

if day == 'SUN' :
    print(7)
elif day == 'MON' :
    print(6)
elif day == 'TUE' :
    print(5)
elif day == 'WED' :
    print(4)
elif day == 'THU' :
    print(3)
elif day == 'FRI' :
    print(2)
elif day == 'SAT' :
    print(1)
N, M = map(int, input().split())
red = [False for i in range(N+1)]
red[1] = True
box = [1 for i in range(N+1)]

for i in range(M):
    x, y = map(int, input().split())
    if red[x]:
        red[y] = True
    box[x] -= 1
    box[y] += 1
    if box[i] == 0:
        red[i] = False

ans = 0
for i in range(1, N+1):
    if red[i] and box[i] > 0:
        ans += 1
print(ans)


### FIXED CODE ###

N, M = map(int, input().split())
red = [False for i in range(N+1)]
red[1] = True
box = [1 for i in range(N+1)]

for i in range(M):
    x, y = map(int, input().split())
    if red[x]:
        red[y] = True
    box[x] -= 1
    box[y] += 1
    if box[x] == 0:
        red[x] = False

ans = 0
for i in range(1, N+1):
    if red[i] and box[i] > 0:
        ans += 1
print(ans)
from math import sqrt 
N = int(input())
k = [[int(i) for i in input().split()] for i in range(N)]
result = 0
for i in range(N):
    for j in range(N):
        if i != j:
            result += sqrt((k[i][0] - k[j][0]) * (k[i][0] - k[j][0]) + k[i][1] - k[j][1]) * (k[i][1] - k[j][1]))
print(result / N)

### FIXED CODE ###


from math import sqrt 
N = int(input())
k = [list(map(int, input().split())) for _ in range(N)]
result = 0
for i in range(N):
    for j in range(N):
        if i != j:
            result += sqrt((k[i][0] - k[j][0]) * (k[i][0] - k[j][0]) + (k[i][1] - k[j][1]) * (k[i][1] - k[j][1]))
print(result / N)
N,Ma,Mb = map(int,input().split())
first_half = []
last_half = []
for i in range(N):
	a,b,c = map(int,input().split())
	if i < N // 2:
		first_half.append((a,b,c))
	else:
		last_half.append((a,b,c))

first_half_combination = {}
last_half_combination = {}
def make_all_combination(i,a,b,c,d_list,flag):
	if i == len(d_list):
		if c == 0:
			return

		w = Ma * b - Mb * a
		if flag:
			if w not in first_half_combination or c < first_half_combination[w]:
				first_half_combination[w] = c
		else:
			if -w not in last_half_combination or c < last_half_combination[-w]:
				last_half_combination[-w] = c
		return
	make_all_combination(i+1,a,b,c,d_list,flag)
	make_all_combination(i+1,a+d_list[i][0],b+d_list[i][1],c+d_list[i][2],d_list,flag)

make_all_combination(0,0,0,0,first_half,True)
make_all_combination(0,0,0,0,last_half,False)

INF = 10**8
f_0 = first_half_combination[0] if 0 in last_half_combination else INF
l_0 = first_half_combination[0] if 0 in last_half_combination else INF
ans = min(f_0,l_0) if min(f_0,l_0) < INF else -1
for w in first_half_combination.keys():
	if w == 0:
		continue
	if w in last_half_combination:
		cost = first_half_combination[w] + last_half_combination[w]
		if w == 0:
			cost = min(first_half_combination[w], last_half_combination[w])
		if ans == -1 or cost < ans:
			ans = cost
print(ans)

### FIXED CODE ###

N,Ma,Mb = map(int,input().split())
first_half = []
last_half = []
for i in range(N):
	a,b,c = map(int,input().split())
	if i < N // 2:
		first_half.append((a,b,c))
	else:
		last_half.append((a,b,c))

first_half_combination = {}
last_half_combination = {}
def make_all_combination(i,a,b,c,d_list,flag):
	if i == len(d_list):
		if c == 0:
			return

		w = Ma * b - Mb * a
		if flag:
			if w not in first_half_combination or c < first_half_combination[w]:
				first_half_combination[w] = c
		else:
			if -w not in last_half_combination or c < last_half_combination[-w]:
				last_half_combination[-w] = c
		return
	make_all_combination(i+1,a,b,c,d_list,flag)
	make_all_combination(i+1,a+d_list[i][0],b+d_list[i][1],c+d_list[i][2],d_list,flag)

make_all_combination(0,0,0,0,first_half,True)
make_all_combination(0,0,0,0,last_half,False)

INF = 10**8
f_0 = first_half_combination[0] if 0 in first_half_combination else INF
l_0 = last_half_combination[0] if 0 in last_half_combination else INF
ans = min(f_0,l_0) if min(f_0,l_0) < INF else -1
for w in first_half_combination.keys():
	if w == 0:
		continue
	if w in last_half_combination:
		cost = first_half_combination[w] + last_half_combination[w]
		if w == 0:
			cost = min(first_half_combination[w], last_half_combination[w])
		if ans == -1 or cost < ans:
			ans = cost
print(ans)
A, B = map( int, input().split)
if A+B >= 10:
    print('error')
else:
    print(A+B)

### FIXED CODE ###

A, B = map( int, input().split())
if A+B >= 10:
    print('error')
else:
    print(A+B)
n, m = map(int, input().split())
a = list(map(lambda x: int(x) * (-1), input().split()))
heapq.heapify(a)
for _ in range(m):
    tmp_min = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-tmp_min//2))
print(-sum(a))

### FIXED CODE ###

import heapq
n, m = map(int, input().split())
a = list(map(lambda x: int(x) * (-1), input().split()))
heapq.heapify(a)
for _ in range(m):
    tmp_min = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-tmp_min//2))
print(-sum(a))
from collections import defaultdict
N = int(input())

xy = []
for i in range(N):
    x, y = map(int, input().split())
    xy.append((x, y))

d = defaultdict(int)

for i in range(N):
    for j in range(N):
        if i == j:
            continue
        p, q = (xy[i][0]-xy[j][0], xy[i][1]-xy[j][1])
        d[(p, q)] += 1

print(N-max(d.values()))


### FIXED CODE ###

from collections import defaultdict
N = int(input())

if N == 1:
    print(1)
    exit()

xy = []
for i in range(N):
    x, y = map(int, input().split())
    xy.append((x, y))

d = defaultdict(int)

for i in range(N):
    for j in range(N):
        if i == j:
            continue
        p, q = (xy[i][0]-xy[j][0], xy[i][1]-xy[j][1])
        d[(p, q)] += 1

print(N-max(d.values()))
n = int(input())
a = list(map(int, input().split()))
import collections
#重複のみ
a_rep = {x for x in set(a) if a.count(x)>1}

#全て
a_all = set(a)

#一度だけ
a_once = a_all - a_rep
c = collections.Counter(a)
values, counts = zip(*c.most_common())
if counts[-1] == 1:
	k = counts.index(1)
	del counts[k:]


from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

from collections import deque
t = deque()
for i in counts:
    t.append(cmb(i,2))

t = list(t)
ans = sum(t)

for i in a:
    if i in a_once:
        print(ans)
    else:
        print(ans - c[i] + 1)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
import collections

c = collections.Counter(a)
values, counts = zip(*c.most_common())
counts = list(counts)
if counts[-1] == 1:
	k = counts.index(1)
	del counts[k:]


from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

from collections import deque
t = deque()
for i in counts:
    t.append(cmb(i,2))

t = list(t)
ans = sum(t)

for i in a:
	print(ans - c[i] + 1)
import numpy
 
a = input().split()
L = a(0)
R = a(1)
d = a(2)
 
N = R/d
 
print(math.floor(N))

### FIXED CODE ###

l,r,d = map(int,input().split())
     
print( r//d -(l-1)//d )
N= int(input())
lead_N = int(str(N)[0]) 
end_N = int(str(N)[len(str(N)) - 1])
ans = 0
#print(str(100)[len(str(100)) - 1])
for i in range(1, N + 1):
  lead = int(str(i)[0])
  end = int(str(i)[len(str(i)) - 1])
  # 一桁
  if lead == end:
    ans += 1
  #2桁以上ループ lead + 中間 + end　
  for j in range((len(str(N)) - 2) + 1):
    if end == 0:
      #末尾が0
      continue
    elif end > lead_N and j == (len(str(N)) - 2) :
      #生成する整数がNに収まらない場合
      continue
    elif end == lead_N and j == (len(str(N)) - 2):
      #生成する整数の一部がNに収まらない場合
      #中間の数字

      ans += int(str(N)[1:len(str(N)) - 1])

      if lead <= end_N:
        ans += 1
      #print("b")
      pass
    else:
      #何も気にしないときは組み合わせの分だけたす
      ans += 10 ** j

print(ans)

### FIXED CODE ###

N= int(input())
lead_N = int(str(N)[0]) 
end_N = int(str(N)[len(str(N)) - 1])
ans = 0
#print(str(100)[len(str(100)) - 1])
for i in range(1, N + 1):
  lead = int(str(i)[0])
  end = int(str(i)[len(str(i)) - 1])
  # 一桁
  if lead == end:
    ans += 1
  #2桁以上ループ lead + 中間 + end　
  for j in range((len(str(N)) - 2) + 1):
    if end == 0:
      #末尾が0
      continue
    elif end > lead_N and j == (len(str(N)) - 2) :
      #生成する整数がNに収まらない場合
      continue
    elif end == lead_N and j == (len(str(N)) - 2):
      #生成する整数の一部がNに収まらない場合
      #中間の数字
      if len(str(N)) >= 3:
        ans += int(str(N)[1:len(str(N)) - 1])

      if lead <= end_N:
        ans += 1
      #print("b")
      pass
    else:
      #何も気にしないときは組み合わせの分だけたす
      ans += 10 ** j

print(ans)
import decimal
import math 
X = int(input())
yen = 100
n = 1
while True:
    yen = decimal(math.floor(decimal(yen*1.01*n)))
    if X <= yen:
        print(n)
        break
    n = n + 1

### FIXED CODE ###

import math 
X = int(input())
yen = 100
n = 0
while yen < X:
    n = n + 1
    yen = math.floor(yen*1.01)
    if X <= yen:
        print(n)