"""

参考

blog名  あっとのTECH LOG   2020-01-24 

url     https://at274.hatenablog.com/entry/2020/01/24/060000

id:     AT274

"""



#初期入力

N = int(eval(input()))

 

#

import numpy as np

count = np.zeros((10,10),dtype=np.int64) 

for i in range(1,N+1):

    n_left =str(i)[0]   #左端の数字（N)

    n_right =str(i)[-1] #右端の数字（N)

    count[int(n_left) , int(n_right)] +=1



count_T_copy =count.T.copy()

ans =np.sum(count *count_T_copy)

print(ans)
"""

参考

blog名  あっとのTECH LOG   2020-01-24 

url     https://at274.hatenablog.com/entry/2020/01/24/060000

id:     AT274

"""



#初期入力

N = int(eval(input()))

 

#

import numpy as np

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

#count = np.zeros((10,10),dtype=np.int64) 

for i in range(1,N+1):

    n_left =str(i)[0]   #左端の数字（N)

    n_right =str(i)[-1] #右端の数字（N)

    #cnt[int(n_left) , int(n_right)] +=1

    cnt[int(n_left)][int(n_right)] +=1



count =np.array(cnt,dtype=np.int64)

count_T_copy =count.T.copy()

ans =np.sum(count *count_T_copy)

print(ans)
"""
参考
blog名  あっとのTECH LOG   2020-01-24 
url     https://at274.hatenablog.com/entry/2020/01/24/060000
id:     AT274
"""
# 初期入力
N = int(eval(input()))
#
import numpy as np

count = np.zeros((10, 10), dtype=np.int64)
for i in range(1, N + 1):
    n_left = str(i)[0]  # 左端の数字（N)
    n_right = str(i)[-1]  # 右端の数字（N)
    count[int(n_left), int(n_right)] += 1
count_T_copy = count.T.copy()
ans = np.sum(count * count_T_copy)
print(ans)

"""
参考
blog名  あっとのTECH LOG   2020-01-24 
url     https://at274.hatenablog.com/entry/2020/01/24/060000
id:     AT274
"""
# 初期入力
N = int(eval(input()))
#
import numpy as np

cnt = [[0] * 10 for i in range(10)]
# count = np.zeros((10,10),dtype=np.int64)
for i in range(1, N + 1):
    n_left = str(i)[0]  # 左端の数字（N)
    n_right = str(i)[-1]  # 右端の数字（N)
    # cnt[int(n_left) , int(n_right)] +=1
    cnt[int(n_left)][int(n_right)] += 1
count = np.array(cnt, dtype=np.int64)
count_T_copy = count.T.copy()
ans = np.sum(count * count_T_copy)
print(ans)

-count = np.zeros((10, 10), dtype=np.int64) +cnt = [[0] * 10 for i in range(10)] +# count = np.zeros((10,10),dtype=np.int64) -    count[int(n_left), int(n_right)] += 1 +    # cnt[int(n_left) , int(n_right)] +=1 +    cnt[int(n_left)][int(n_right)] += 1 +count = np.array(cnt, dtype=np.int64)