qyliang/CodeNanoFix huggingface dataset:
# Buggy code:
n = int(input())
a = list(map(int, input().split()))
a.sort()

for i in range(len(a)):
    if a[i] == a[i-1]
    print("NO")
else:
    print("YES")

# Fixed code:
n = int(input())
a = list(map(int, input().split()))
a.sort()

for i in range(len(a)):
    if a[i] == a[i-1]:
        print("NO")
        break
else:
    print("YES")
# Buggy code:
n=int(input())
a=[int(i) for i in input().split()]
answer="YES"
for i in range(n-1):
  if a[i]==a[i+1]:
    answer="NO"
    break
print(answer)

# Fixed code:
n=int(input())
a=[int(i) for i in input().split()]
answer="YES"
a.sort()
for i in range(n-1):
  if a[i]==a[i+1]:
    answer="NO"
    break
print(answer)
# Buggy code:
num = int(input())
str_list = input.split(" ")
 
num_dict = {}
yes = True
for s in str_list:
  if s in num_dict:
    yes = False
    break
  else:
    num_dict[s] = 1
if yes:
  print("YES")
else:
  print("NO")

# Fixed code:
num = input()
str_list = input().split(" ")
 
yes = True
num_dict = {}
for s in str_list:
	if s in num_dict:
		yes = False
		break
	else:
		num_dict[s] = 1
if yes:
	print("YES")
else:
	print("NO")
# Buggy code:
import sys
A = list(map(int, input().split()))
n = int(input())

if len(A) == len(set(A)):
    print("YES")
else:
    print("NO")

# Fixed code:
n = int(input())
A = list(map(int,input().split()))
if(len(A) == len(set(A))):
    print('YES')
else:
    print('NO')
# Buggy code:
#154 Distinct or not
n = int(input())
a = list(map(int,input().split())
b = set(a)

if len(a) == b:
         print('YES')
else:
    print('NO')

# Fixed code:
#154 Distinct or not
n = int(input())
a = list(map(int,input().split()))
b = len(set(a))

if len(a) == b:
    print('YES')
else:
    print('NO')
# Buggy code:
from sys import stdin

n=int(input())
p=list(map(int,input().split()))

a=p[0]
cnt=0

for i in range(1,n):
    if p[i]<=a
    cnt+=1
    a = p[1]

print(cnt)
      

# Fixed code:
from sys import stdin

n=int(input())
p=list(map(int,input().split()))

a=p[0]
cnt=1

for i in range(1,n):
    if p[i]<a:
        cnt+=1
        a = p[i]

print(cnt)
# Buggy code:
n=int(input())
p=list(map(int,input().split()))
ans=0
mini=10e+7
for i in range(n):
  if(p[i]>mini):
    ans+=1
    mini=p[i]
print(ans)

# Fixed code:
n=int(input())
p=list(map(int,input().split()))
ans=0
mini=10e+6
for i in range(n):
    if(mini>p[i]):
        ans+=1
        mini=p[i]
print(ans)
# Buggy code:
N = int(input())
M = 0
for P in map(int, input().split()):
    if P <= N:
        N = x
        M += 1
print(M)

# Fixed code:
N = int(input())
M = 0
for P in map(int, input().split()):
    if P <= N:
        N = P
        M += 1
print(M)
# Buggy code:
N = int(input())
P = list(map(int, input().split()))

result = 0
m = P[0]
for i in range(N):
    if P[i] <= m:
        print(P[i], m)
        result += 1
        m = P[i]
print(result)

# Fixed code:
N = int(input())
P = list(map(int, input().split()))

result = 0
m = P[0]
for i in range(N):
    if P[i] <= m:
        result += 1
        m = P[i]
print(result)
# Buggy code:
def solve(n, p_list):

    count = 0
    j = 2 * 10^^5 +1
    for i in p_list:
        if j > i:
            count += 1
            j = i

    return count

if __name__ == "__main__":

    n = int(input())
    p_list = [int(i) for i in input().split()]
    ans = solve(n, p_list)
    print(ans)

# Fixed code:
def solve(n, p_list):

    count = 0
    j = 2 * 10**5 +1
    for i in p_list:
        if j > i:
            count += 1
            j = i

    return count

if __name__ == "__main__":

    n = int(input())
    p_list = [int(i) for i in input().split()]
    ans = solve(n, p_list)
    print(ans)
# Buggy code:
N = int(input())
p = [int(e) for e in input().split(" ")]
low = p[0]
c = 0
for i in range(N):
    print(p[i], low)
    if(p[i] <= low):
        c += 1
        low = p[i]
print(c)

# Fixed code:
N = int(input())
p = [int(e) for e in input().split(" ")]
low = p[0]
c = 0
for i in range(N):
    if(p[i] <= low):
        c += 1
        low = p[i]
print(c)
# Buggy code:
import math as mt
n=int(input())
a=list(map(int,input().split()))
ans=1001001
res=0
for i in range(n):
    if ans>a[i]:
        res+=1
        ans=min(ans,res)
print(res)

# Fixed code:
import math as mt
n=int(input())
a=list(map(int,input().split()))
ans=1001001
res=0
for i in range(n):
    if ans>a[i]:
        res+=1
        ans=min(ans,a[i])
print(res)
# Buggy code:
n=int(input())
x=list(map(int,input().split()))


min_i = [x[0]]

for i in range(1,n):
    min_i.append(min(min_i[i-1],x[i]))

count=0
for i in range(0,n-1):
    if min_i[i-1] < x[i]:
        count=count+1
#  if x[i-1]>=x[i]:
#    count=count+1
    
#if min(x)==x[n-1]:
#  count=count+1
print(n-count)


# Fixed code:
n=int(input())
x=list(map(int,input().split()))



min_i = [x[0]]

for i in range(1,n):
    min_i.append(min(min_i[i-1],x[i]))

count=0
for i in range(1,n):
    if min_i[i-1] < x[i]:
        count=count+1
#  if x[i-1]>=x[i]:
#    count=count+1
    
#if min(x)==x[n-1]:
#  count=count+1
print(n-count)
# Buggy code:
n = int(input())
p = [int(s) for s in input().split()]
count = 0
m = p[0]
for a in range(n):
     i = p[a]
     if M>=i:
         count+=1
         m = i
        
print(count)

# Fixed code:
n = int(input())
p = [int(s) for s in input().split()]
count = 0
M = p[0]
for a in range(n):
     i = p[a]
     if M >=i :
          count+=1
          M = i
print(count)
# Buggy code:
N = int(input())
i = list(map(int, input().split()))

min = i[0]
count = 1

for n in range(N-1):
    if min > i[n]:
        min = i[n]
        count +=1
    else: pass

print(count)

# Fixed code:
N = int(input())
i = list(map(int, input().split()))

min = i[0]
count = 1

for n in range(N-1):
    if min >= i[n+1]:
        min = i[n+1]
        count +=1
    else: pass

print(count)
# Buggy code:
N = int(input)
P = list(map(int, input().split()))

result = 0
mini = [P[0]]

for i in range(N-1):
    if mini[i]>P[i+1]:
        mini.append(P[i+1])
    else:
        mini.append(mini[i])

for i in range(N):
    if P[i]==mini[i]:
        result += 1

print(result)


# Fixed code:
N = int(input())
P = list(map(int, input().split()))
 
result = 0
mini = [P[0]]
 
for i in range(N-1):
    if mini[i]>P[i+1]:
        mini.append(P[i+1])
    else:
        mini.append(mini[i])
 
for i in range(N):
    if P[i]==mini[i]:
        result += 1
 
print(result)
# Buggy code:
n = int(input())
p = list(map(int,input().split()))
li = [0]*n
sta = 1

for i in range(n):
  if p[i] < sta:
    li[i]=1
  else:
    sta = p[i]

print(sum(li))

# Fixed code:
n = int(input())
p = list(map(int,input().split()))
li = [0]*n
sta = n

for i in range(n):
  if p[i] <= sta:
    li[i]=1
    sta = p[i]

print(sum(li))
# Buggy code:
n=int(input())
p=list(map(int,input().split()))
ans=0
m=max(p)

for i in range(n):
  if m>p[i]:
    ans+=1
    m=p[i]

print(ans)

# Fixed code:
n=int(input())
p=list(map(int,input().split()))
ans=0
m=n+1

for i in range(n):
  if m>p[i]:
    ans+=1
    m=p[i]

print(ans)
# Buggy code:
N = int(input())

List = list(map,input().split())

m = 1
cnt = 0

for i in range(N):
  a = List[i]
  if a <= m :
    cnt += 1
    m = a
    
print(int(cnt))

# Fixed code:
N = int(input())

List = list(map(int,input().split()))

m = 10 ** 10
cnt = 0

for i in range(N):
  a = List[i]
  if a <= m :
    cnt += 1
    m = a
    
print(int(cnt))
# Buggy code:
n = int(input())
li = list(map(int,input().split()))

i = 0
j = 0
a = 10**5
for i in range(i,n-1):
  a = min(a,li[i])
  if a == li[i]:
    j = j + 1

print(j)

# Fixed code:
n = int(input())
li = list(map(int,input().split()))

i = 0
j = 0
a = 10**6
for i in range(i,n):
  a = min(a,li[i])
  if a == li[i]:
    j = j + 1

print(j)
# Buggy code:
n = int(input())
p = list(map(int, input().split()))
count = 0
min = p[0]

for i in range(n):
    if min >= p[i]:
        count += 1

print(count)

# Fixed code:
n=int(input())
p=list(map(int,input().split()))
min=p[0]
ans=1
for i in range(1,n):
    if min>=p[i]:
        ans+=1
        min=p[i]
print(ans)
# Buggy code:
n = int(input())
p = list(map(int, input().split( )))
c =0
m = p[0]
for i in range(n):
    if m => p[i]:
        c += 1
        m = p[i]
print(c)

# Fixed code:
n = int(input())
p = list(map(int, input().split()))

m = p[0]
count = 1
for i in range(1,n):
    if m >= p[i]:
        m = p[i]
        count += 1
        
print(count)
# Buggy code:
N = int(input())
P = list(map(int, input().split()))

mmin = P[0]
ans = 0
for i in range(N):
  if mmin < P[i]:
    continue
  else:
    mmin >= P[i]:
      mmin = P[i]
      ans += 1

print(ans)

# Fixed code:
N = int(input())
P = list(map(int, input().split()))
 
mmin = P[0]
ans = 0
for i in range(N):
  if mmin < P[i]:
    continue
  else:
    mmin = P[i]
    ans += 1

print(ans)
# Buggy code:
n=int(input())
l=list(map(int,input().split()))
ans=0
tmp=0
for i in range(1,n):
    if tmp<=l[i]:
      tmp=l[i]
      ans+=1
print(ans)


# Fixed code:
n=int(input())
l=list(map(int,input().split()))
ans=0
tmp=l[0]
for i in range(n):
    if tmp>=l[i]:
      tmp=l[i]
      ans+=1
print(ans)
# Buggy code:
n=int(input())
p=list(map(int,input().split()))
a=1000000000
cnt=1
for i in range(1,n):
	if p[i]<=a:
		cnt+=1
		a=p[i]
print(cnt)


# Fixed code:
n=int(input())
p=list(map(int,input().split()))
a=p[0]
cnt=1
for i in range(1,n):
	if p[i]<a:
		cnt+=1
		a=p[i]
print(cnt)
# Buggy code:
# cook your dish here
n=int(input())
a=list(map(int,input().split()))
st=[]
for i in range(n):
    if i==0:
        st.append(a[i])
    else:
        if st[-1]>=a[i]:
            ans+=1
        else:
            st.append(a[i])

# Fixed code:
# cook your dish here
n=int(input())
a=list(map(int,input().split()))
st=[]
ans=0
for i in range(n):
    if i==0:
        st.append(a[i])
        ans+=1
    else:
        if st[-1]>=a[i]:
            ans+=1
            st.append(a[i])
print(ans)
# Buggy code:
N = int(input())
P = list(map(int, input().split()))

ans=0
p_min=S[0]
for i in range(N):
    if p_min >= P[i]:
        ans++
        p_min = P[i]

print(ans)


# Fixed code:
N = int(input())
P = list(map(int, input().split()))

ans=0
p_min=P[0]
for i in range(N):
    if p_min >= P[i]:
        ans += 1
        p_min = P[i]

print(ans)
# Buggy code:
N = int(input())
S = list(map(int,input().split()))
counter = int(0)
minNum = S[0]

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

else:
  for i in range(N):
    if minNum >= S[i]:
      counter = counter + 1
    else:
      minNum = S[i]
    
  print(counter)

# Fixed code:
N = int(input())
S = list(map(int,input().split()))
counter = int(0)
minNum = S[0]

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

else:
  for i in range(N):
    if minNum >= S[i]:
      minNum = S[i]
      counter = counter + 1
    
  print(counter)
# Buggy code:
n = int(input())
p = list(map(int, input().split()))

j = p[0]
count = 0
for i in range(n):
    if j == 1:
        break
    if p[i] <= j:
        count += 1
        j = p[i]
print(count)

# Fixed code:
n = int(input())
p = list(map(int, input().split()))

j = p[0]
count = 0
for i in range(n):
    if p[i] <= j:
        count += 1
        j = p[i]
print(count)
# Buggy code:
n = int(input())
p = list(map(int, input().split()))
c = 0
m = n + 1
for i in p:
  if i == min(m, i):
    c += 1
print(c)

# Fixed code:
n = int(input())
p = list(map(int, input().split()))
c = 0
m = n + 1
for i in p:
  if i < m:
    c += 1
    m = i
print(c)
# Buggy code:
n = int(input())
p_li = list(map(int,input().split()))
min_v = p_li[0]
ans=1
for x in p_li:
    if x == 1:
        break
    if min_v>=x:
        min_v=x
    else:
        ans+=1
print(ans)

# Fixed code:
n = int(input())
p_li = list(map(int,input().split()))
min_v = p_li[0]
ans=1
for x in p_li:
    if min_v>x:
        min_v=x
        ans+=1
print(ans)
# Buggy code:
import numpy as np

N = int(input())
n = [int(x) for x in input().split()]
n=np.array(n)

a=1
for i in range(1,N):
    if np.min(n[:i]) > n[i] : a+1   
print(a)

# Fixed code:
import numpy as np

N = int(input())
n = [int(x) for x in input().split()]
n=np.array(n)

a=1
pos=0
for i in range(1,N):
    if n[pos] > n[i] :
        a+=1
        pos=i
print(a)
# Buggy code:
n = int(input())
a = list(map(int, input().split()))
ans = 0

for i in range(n):
    if a[n] <= min(a[:n]):
        ans += 1

print(ans)

# Fixed code:
n = int(input())
a = list(map(int, input().split()))
ans = 0
minimum = n

for i in range(n):
    if a[i] <= minimum:
        ans += 1
        minimum = a[i]

print(ans)
# Buggy code:
import bisect
N = int(input())
P = list(map(int, input().split()))

count = 0
last_min = P[i]
for i in range(N):
    last_min = min(last_min, P[i])
    if i == 0:
        count += 1
    elif last_min == P[i]:
        count += 1
print(count)

# Fixed code:
import bisect
N = int(input())
P = list(map(int, input().split()))

count = 0
last_min = P[0]
for i in range(N):
    last_min = min(last_min, P[i])
    if i == 0:
        count += 1
    elif last_min == P[i]:
        count += 1
print(count)
# Buggy code:
n = int(input())
p = list(map(int, input().split()))
count = 0
r = p[0]
for i in range(1, n+1):
    s = min(r, p[i-1])
    if (s == p[i-1]):
        count += 1
print(count)

# Fixed code:
n = int(input())
p = list(map(int, input().split()))
count = 0
s = p[0]
for i in range(1, n+1):
    s = min(s, p[i-1])
    if (s == p[i-1]):
        count += 1
print(count)
# Buggy code:
n = int(input())

d = [[0]*10 for i in range(10)]

for i in range(1, n+1):
  i_ = str(i)
  x = int(i_[0])
  y = int(i_[-1])
  d[x][y] += 1
  
print(d)
ans = 0
for i in range(10):
  for j in range(10):
    ans += d[i][j]*d[j][i]
    
print(ans)

# Fixed code:
n = int(input())

d = [[0]*10 for i in range(10)]

for i in range(1, n+1):
  i_ = str(i)
  x = int(i_[0])
  y = int(i_[-1])
  d[x][y] += 1

ans = 0
for i in range(10):
  for j in range(10):
    ans += d[i][j]*d[j][i]
    
print(ans)
# Buggy code:
n = int(input())

str_n = str(n)
 
c = [[0]*10 for _ in range(10)]
for i in range(1,N+1):
	c[int(str(i)[0])][int(str(i)[-1])] += 1
    
ans = 0
for i in range(1, 10):
	for j in range(1, 10):
        ans += c[i][j]*c[j][i]

print(ans)

# Fixed code:
N = int(input())
 
c = [[0]*10 for _ in range(10)]
for i in range(1,N+1):
	c[int(str(i)[0])][int(str(i)[-1])] += 1
    
ans = 0
for i in range(1, 10):
	for j in range(1, 10):
		ans += c[i][j]*c[j][i]

print(ans)
# Buggy code:
strN = input()
N = int(strN)
p = {i: {j: 0 for j in range(1, 10)} for i in range(1, 10)}
for i in range(1, 10):
    for j in range(1, 10):
        for k in range(1, N):
            strk = str(k)
            if str(i) == strk[0] and str(j) == strk[-1]:
                p[i][j] += 1

ans = 0
for i in range(1, 10):
    for j in range(1, 10):
        ans += p[i][j] * p[j][i]

print(ans)


# Fixed code:
strN = input()
N = int(strN)
p = {i: {j: 0 for j in range(1, 10)} for i in range(1, 10)}
for k in range(1, N+1):
    strk = str(k)
    i = int(strk[0])
    j = int(strk[-1])
    if i == 0 or j == 0:
        continue
    p[i][j] += 1

ans = 0
for i in range(1, 10):
    for j in range(1, 10):
        ans += p[i][j] * p[j][i]

print(ans)
# Buggy code:
n = int(input())
X = ['']
for i in range(1, 6):
    for j in range(10**i):
        X.append(str(j).zfill(i))
cnt = 0
for a in range(1, n+1):
    x = str(a)[0]
    y = str(a)[-1]
    if x == y:
        cnt += 1
    if y == '0':
        continue
    l, r = 0, len(X)
    while r-l > 1:
        c = (l+r)//2
        if int(y+X[c]+x) <= n:
            l = c
        else:
            r = c
    cnt += r
print(cnt)


# Fixed code:
n = int(input())
X = ['']
for i in range(1, 6):
    for j in range(10**i):
        X.append(str(j).zfill(i))
cnt = 0
for a in range(1, n+1):
    x = str(a)[0]
    y = str(a)[-1]
    if x == y:
        cnt += 1
    if y == '0':
        continue
    l, r = -1, len(X)-1
    while r-l > 1:
        c = (l+r)//2
        if int(y+X[c]+x) <= n:
            l = c
        else:
            r = c
    cnt += r
print(cnt)
# Buggy code:
import math

def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

N = int(input())
sN = str(N)
l = len(sN)

ans = 0
for n in range(1, min(10, N+1)):
    sn = str(n)
    ans += 1
    
    cnt = 1
    for i in range(1, l-1):
        cnt *= 10
        ans += cnt

    if l == 2:
        if sN >= sn + sn:
            ans += 1
    elif l > 2 and sN[0] >= sn[-1]:
        hoge = int(sN[1:-1])
        if sN[-1] < sn[0] and sN[0] == sn[-1]:
            hoge -= 1
        ans += hoge + 1

for n in range(11, N+1):
    sn = str(n)
    if sn[-1] != "0":
        if n > 10 and sn[0] == sn[-1]:
            ans += 1


        cnt = 1
        for i in range(2, l-1):
            ans += cnt
            cnt *= 10

        if l == 2:
            if sN >= sn[-1] + sn[0]:
                ans += 1
        elif l > 2 and sN[0] >= sn[-1]:
            hoge = int(sN[1:-1])
            if sN[-1] < sn[0] and sN[0] == sn[-1]:
                hoge -= 1
            ans += hoge + 1


print(ans)


# Fixed code:
import math

def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

N = int(input())
sN = str(N)
l = len(sN)

ans = 0
for n in range(1, min(10, N+1)):
    sn = str(n)
    ans += 1
    
    cnt = 1
    for i in range(2, l):
        ans += cnt
        cnt *= 10

    if l == 2:
        if sN >= sn[-1] + sn[0]:
            ans += 1
    elif l > 2 and sN[0] >= sn[-1]:
        if sN[0] == sn[-1]:
            hoge = int(sN[1:-1])
            if sN[-1] < sn[0]:
                hoge -= 1
            ans += hoge + 1
        elif sN[0] > sn[-1]:
            ans += cnt

for n in range(11, N+1):
    sn = str(n)
    if sn[-1] != "0":
        if n > 10 and sn[0] == sn[-1]:
            ans += 1


        cnt = 1
        for i in range(2, l):
            ans += cnt
            cnt *= 10

        if l == 2:
            if sN >= sn[-1] + sn[0]:
                ans += 1
        elif l > 2 and sN[0] >= sn[-1]:
            if sN[0] == sn[-1]:
                hoge = int(sN[1:-1])
                if sN[-1] < sn[0]:
                    hoge -= 1
                ans += hoge + 1
            elif sN[0] > sn[-1]:
                ans += cnt

print(ans)
# Buggy code:

N = int(input())


def calc(num):
    s = list(str(num))[::-1]
    s2 = int(s[-1])
    s1 = int(s[0])

    keta = 0
    while True:
        num = num // 10
        keta += 1
        if num == 0:
            break

    if s1 == s2:
        if keta == 1:
            return 1
        elif keta == 2:
            return 1 + 2
        else:
            return int(''.join(s[1:-1][::-1])) * 2 - 1 + 3

    elif s1 > s2:
        if keta == 2:
            return 0
        else:
            ans = 0
            for i in range(keta - 2):
                ans += 10 ** i
            return ans * 2
    else:
        if s1 == 0:
            return 0
        else:
            ans = 0
            for i in range(keta - 1):
                ans += 10 ** i
            return ans * 2


# print(10, calc(10))

dp = [0] * (N+1)

for i in range(1, N+1):
    dp[i] = dp[i-1] + calc(i)

# print(dp)
print(dp[N])



# Fixed code:

N = int(input())


def calc(num):
    s = list(str(num))[::-1]
    s2 = int(s[-1])
    s1 = int(s[0])

    keta = 0
    while True:
        num = num // 10
        keta += 1
        if num == 0:
            break

    if s1 == s2:
        if keta == 1:
            return 1
        elif keta == 2:
            return 1 + 2
        else:
            ans = 0
            for i in range(keta - 3):
                ans += (10 ** (i+1)) * 2
            ans += (int(''.join(s[1:-1][::-1]))+1) * 2 + 3
            return ans

    elif s1 > s2:
        if keta == 2:
            return 0
        else:
            ans = 0
            for i in range(keta - 2):
                ans += 10 ** i
            return ans * 2
    else:
        if s1 == 0:
            return 0
        else:
            ans = 0
            for i in range(keta - 1):
                ans += 10 ** i
            return ans * 2


# print(10, calc(10))

dp = [0] * (N+1)

for i in range(1, N+1):
    dp[i] = dp[i-1] + calc(i)

# print(dp)
print(dp[N])
# Buggy code:
import numpy as np
N = int(input())

cnt = np.zeros((N,N))

for x in map(str,range(1,N+1)):
    cnt[int(x[0]),int(x[-1])] += 1

ans = 0
for i in range(1,10):
    for j in range(1,10):
        ans += cnt[i,j] * cnt[j,i]

print(int(ans))

# Fixed code:
import numpy as np
N = int(input())

cnt = np.zeros((10,10))

for x in map(str,range(0,N+1)):
    cnt[int(x[0]),int(x[-1])] += 1

ans = 0
for i in range(1,10):
    for j in range(1,10):
        ans += cnt[i,j] * cnt[j,i]

print(int(ans))
# Buggy code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from fractions import Fraction
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations, accumulate
from operator import add, mul, sub, itemgetter, attrgetter


import sys
# sys.setrecursionlimit(10**6)
# readline = sys.stdin.buffer.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(readline())


def read_int_n():
    return list(map(int, readline().split()))


def read_float():
    return float(readline())


def read_float_n():
    return list(map(float, readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()


def ep(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.perf_counter()
        ret = f(*args, **kwargs)
        e = time.perf_counter()

        ep(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N):
    c = defaultdict(Counter)
    for i in range(1, N+1):
        s = str(i)
        c[int(s[0])*10+int(s[-1])] += 1

    ans = 0
    for i, j in product(range(1, 10), repeat=2):
        ans += c[10*i+j] * c[10*j+i]

    return ans


def main():
    N = read_int()
    print(slv(N))


if __name__ == '__main__':
    main()


# Fixed code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from fractions import Fraction
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations, accumulate
from operator import add, mul, sub, itemgetter, attrgetter


import sys
# sys.setrecursionlimit(10**6)
# readline = sys.stdin.buffer.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(readline())


def read_int_n():
    return list(map(int, readline().split()))


def read_float():
    return float(readline())


def read_float_n():
    return list(map(float, readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()


def ep(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.perf_counter()
        ret = f(*args, **kwargs)
        e = time.perf_counter()

        ep(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N):
    c = Counter()
    for i in range(1, N+1):
        s = str(i)
        c[int(s[0])*10+int(s[-1])] += 1

    ans = 0
    for i, j in product(range(1, 10), repeat=2):
        ans += c[10*i+j] * c[10*j+i]

    return ans


def main():
    N = read_int()
    print(slv(N))


if __name__ == '__main__':
    main()
# Buggy code:
N = int(input())

g = [[0] * (N + 1) for _ in range(N + 1)]
for i in range(1, N + 1):
    a = int(str(i)[0])
    b = int(str(i)[-1])
    g[a][b] += 1
ans = 0
for i in range(1, N + 1):
    for j in range(1, N + 1):
        ans += g[i][j]*g[j][i]

print(ans)

# Fixed code:
N = int(input())

g = [[0] * (10) for _ in range(10)]
for i in range(1, N + 1):
    a = int(str(i)[0])
    b = int(str(i)[-1])
    g[a][b] += 1
ans = 0
for i in range(1, 10):
    for j in range(1, 10):
        ans += g[i][j]*g[j][i]

print(ans)