
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')


# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)



# slower version:

n=int(eval(input()))

D={}

DD={}

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

   s=(str(i)[0],str(i)[-1])

   t=(str(i)[-1],str(i)[0])

   if s not in D:

      D[s]=1

   else:

      D[s]+=1

   if t not in DD:

      DD[t]=1

   else:

      DD[t]+=1

ans=0

for i in D:

   if i in DD:

      ans+=D[i]*DD[i]

print(ans)

      

# optimized version of the same code:

n=int(eval(input()))

D={}

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

   s=(str(i)[0],str(i)[-1])

   if s in D:

      D[s]+=1

   else:

      D[s]=1



ans=0

for aj,bj in D:

   if (bj,aj) in D:

      ans+=D[(aj,bj)]*D[(bj,aj)]

print(ans)
n = int(eval(input()))
D = {}
DD = {}
for i in range(1, n + 1):
    s = (str(i)[0], str(i)[-1])
    t = (str(i)[-1], str(i)[0])
    if s not in D:
        D[s] = 1
    else:
        D[s] += 1
    if t not in DD:
        DD[t] = 1
    else:
        DD[t] += 1
ans = 0
for i in D:
    if i in DD:
        ans += D[i] * DD[i]
print(ans)

n = int(eval(input()))
D = {}
for i in range(1, n + 1):
    s = (str(i)[0], str(i)[-1])
    if s in D:
        D[s] += 1
    else:
        D[s] = 1
ans = 0
for aj, bj in D:
    if (bj, aj) in D:
        ans += D[(aj, bj)] * D[(bj, aj)]
print(ans)

-DD = {} -    t = (str(i)[-1], str(i)[0]) -    if s not in D: +    if s in D: +        D[s] += 1 +    else: -    else: -        D[s] += 1 -    if t not in DD: -        DD[t] = 1 -    else: -        DD[t] += 1 -for i in D: -    if i in DD: -        ans += D[i] * DD[i] +for aj, bj in D: +    if (bj, aj) in D: +        ans += D[(aj, bj)] * D[(bj, aj)]