Input:
# 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:

from scipy.spatial import distance

def solve(string):

    n, d, *x = list(map(int, string.split()))

    x = [tuple(c) for c in zip(*[iter(x)] * d)]

    dist = distance.cdist(x, x)

    return str(((dist == dist.astype("int32")).sum() - n) // 2)

if __name__ == '__main__':

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

    print((solve('{} {}\n'.format(n, m)+'\n'.join([eval(input()) for _ in range(n)]))))

# optimized version of the same code:

import math

N,D = list(map(int,input().split()))

X = [list(map(float, input().split())) for i in range(N)]

counter = 0

for i, x0 in enumerate(X):

    for x1 in X[i+1:]:

        if math.sqrt(sum([(a-b)**2 for a, b in zip(x0,x1)])).is_integer():

            counter+=1

print(counter)

from scipy.spatial import distance

def solve(string):
    n, d, *x = list(map(int, string.split()))
    x = [tuple(c) for c in zip(*[iter(x)] * d)]
    dist = distance.cdist(x, x)
    return str(((dist == dist.astype("int32")).sum() - n) // 2)

if __name__ == "__main__":
    n, m = list(map(int, input().split()))
    print(
        (solve("{} {}\n".format(n, m) + "\n".join([eval(input()) for _ in range(n)])))
    )

import math

N, D = list(map(int, input().split()))
X = [list(map(float, input().split())) for i in range(N)]
counter = 0
for i, x0 in enumerate(X):
    for x1 in X[i + 1 :]:
        if math.sqrt(sum([(a - b) ** 2 for a, b in zip(x0, x1)])).is_integer():
            counter += 1
print(counter)

-    n, d, *x = list(map(int, string.split()))

-    x = [tuple(c) for c in zip(*[iter(x)] * d)]

-    return str(((dist == dist.astype("int32")).sum() - n) // 2)

-    n, m = list(map(int, input().split()))

-        (solve("{} {}\n".format(n, m) + "\n".join([eval(input()) for _ in range(n)])))

+X = [list(map(float, input().split())) for i in range(N)]

+        if math.sqrt(sum([(a - b) ** 2 for a, b in zip(x0, x1)])).is_integer():


Input:
# 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:

import numpy as np

import heapq

N = int(eval(input()))

A =  np.sort([int(x) for x in input().split(" ")])[::-1]

q = [(-A[1], (0, 1)), (-A[1], (0, 1))]

confort = A[0]

heapq.heapify(q)

i = 2

while N > i:

    m = heapq.heappop(q)

    # print(f"{m[1][0]}と{m[1][1]}の間に割り込む. 気持ち良さ {-m[0]}")

    confort -= m[0]

    heapq.heappush(q, (-A[i], (i, m[1][0])))

    heapq.heappush(q, (-A[i], (i, m[1][1])))

    i += 1

print(confort)

# optimized version of the same code:

N = int(eval(input()))

A = sorted([int(x) for x in input().split(" ")])[::-1]

N -= 2

S = A[0]

i = 1

while 1:

    if N == 0:

        break

    if N == 1:

        S += A[i]

        break

    S += 2 * A[i]

    N -= 2

    i += 1

print(S)

-A = np.sort([int(x) for x in input().split(" ")])[::-1]

+A = sorted([int(x) for x in input().split(" ")])[::-1]


Input:
# 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:

import sys

input = sys.stdin.readline

read = sys.stdin.read

n = int(eval(input()))

A = list(map(int, read().split()))

L = sorted([(j, i) for i, j in enumerate(A)])

count = 0

for i in range(n):

  if (L[i][1]-i)%2:

    count += 1

ans = (count+1) // 2

print(ans)

# optimized version of the same code:

import sys

input = sys.stdin.readline

read = sys.stdin.read

n = int(eval(input()))

A = list(map(int, read().split()))

L = sorted([(j, i) for i, j in enumerate(A)])

count = 0

for i in range(n):

  count += (L[i][1]-i)%2

ans = (count+1) // 2

print(ans)

import sys

input = sys.stdin.readline
read = sys.stdin.read
n = int(eval(input()))
A = list(map(int, read().split()))
L = sorted([(j, i) for i, j in enumerate(A)])
count = 0
for i in range(n):
    if (L[i][1] - i) % 2:
        count += 1
ans = (count + 1) // 2
print(ans)

import sys

input = sys.stdin.readline
read = sys.stdin.read
n = int(eval(input()))
A = list(map(int, read().split()))
L = sorted([(j, i) for i, j in enumerate(A)])
count = 0
for i in range(n):
    count += (L[i][1] - i) % 2
ans = (count + 1) // 2
print(ans)


Input:
# 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:

# Acceptance of input

import sys

file_input = sys.stdin

X, Y, E = list(map(int, file_input.readline().split()))

v_num = X + Y + 2

adj_mat = [[0] * (v_num) for i in range(v_num)]

for line in file_input:

    x, y = list(map(int, line.split()))

    adj_mat[x][X + y] = 1

s = X + Y

t = s + 1

for i in range(X):

    adj_mat[s][i] = 1

for i in range(X, s):

    adj_mat[i][t] = 1

# Dinic's algorithm

import collections

# BFS for residual capacity network to construct level graph

def bfs(start, goal, parent):

    unvisited = [True] * v_num

    queue = collections.deque()

    queue.append(start)

    unvisited[start] = False

    while queue:

        u = queue.popleft()

        for v, r_capacity in enumerate(adj_mat[u]):

            if unvisited[v] and (r_capacity > 0):

                parent[v].append(u)

                queue.append(v)

                unvisited[v] = False

    return unvisited[goal]

# DFS for level graph and construct blocking flow

def dfs(goal, path, parent, blocking_flow):

    v = path[-1]

    if v == goal:

        aug_path_flow = 10000

        for x, y in zip(path[1:], path[:-1]):

            aug_path_flow = min(aug_path_flow, adj_mat[x][y])

        for x, y in zip(path[1:], path[:-1]):

            adj_mat[x][y] -= aug_path_flow

            adj_mat[y][x] += aug_path_flow

        blocking_flow[0] += aug_path_flow

    else:

        for u in parent[v]:

            path.append(u)

            dfs(goal, path, parent, blocking_flow)

            path.pop()

def dinic(source, sink):

    max_flow = 0

    parent = [[] for i in range(v_num)]

    while not bfs(source, sink, parent):

        blocking_flow = [0]

        path = [sink]

        # search in reverse direction from sink

        dfs(source, path, parent, blocking_flow)

        max_flow += blocking_flow[0]

        parent = [[] for i in range(v_num)]

    return max_flow

# output

print((dinic(s, t)))

# optimized version of the same code:

# Acceptance of input

import sys

file_input = sys.stdin

X, Y, E = list(map(int, file_input.readline().split()))

v_num = X + Y + 2

adj_mat = [[0] * (v_num) for i in range(v_num)]

for line in file_input:

    x, y = list(map(int, line.split()))

    adj_mat[x][X + y] = 1

s = X + Y

t = s + 1

for i in range(X):

    adj_mat[s][i] = 1

for i in range(X, s):

    adj_mat[i][t] = 1

# Dinic's algorithm

import collections

# BFS for residual capacity network to construct level graph

def bfs(start, goal, parent):

    level = [v_num] * v_num

    unvisited = [True] * v_num

    queue = collections.deque()

    queue.append(start)

    level[start] = 0

    unvisited[start] = False

    while queue:

        u = queue.popleft()

        next_level = level[u] + 1

        for v, r_capacity in enumerate(adj_mat[u]):

            if (level[v] >= next_level) and (r_capacity > 0):

                level[v] = next_level

                parent[v].append(u)

                if unvisited[v]:

                    queue.append(v)

                    unvisited[v] = False

    return level[goal]

# DFS for level graph and construct blocking flow

def dfs(goal, path, parent, blocking_flow):

    v = path[-1]

    if v == goal:

        aug_path_flow = 10000

        for x, y in zip(path[1:], path[:-1]):

            aug_path_flow = min(aug_path_flow, adj_mat[x][y])

        for x, y in zip(path[1:], path[:-1]):

            adj_mat[x][y] -= aug_path_flow

            adj_mat[y][x] += aug_path_flow

        blocking_flow[0] += aug_path_flow

    else:

        for u in parent[v]:

            path.append(u)

            dfs(goal, path, parent, blocking_flow)

            path.pop()

def dinic(source, sink):

    max_flow = 0

    parent = [[] for i in range(v_num)]

    while bfs(source, sink, parent) != v_num:

        blocking_flow = [0]

        path = [sink]

        # search in reverse direction from sink

        dfs(source, path, parent, blocking_flow)

        max_flow += blocking_flow[0]

        parent = [[] for i in range(v_num)]

    return max_flow

# output

print((dinic(s, t)))

-            if unvisited[v] and (r_capacity > 0):

+            if (level[v] >= next_level) and (r_capacity > 0):

+                    unvisited[v] = False

-    while not bfs(source, sink, parent):

+    while bfs(source, sink, parent) != v_num:


Input:
# 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:

import sys, re

from collections import deque, defaultdict, Counter

from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2, log

from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby

from operator import itemgetter, mul

from copy import deepcopy

from string import ascii_lowercase, ascii_uppercase, digits

from bisect import bisect, bisect_left, insort, insort_left

from fractions import gcd

from heapq import heappush, heappop

from functools import reduce

from decimal import Decimal

def input(): return sys.stdin.readline().strip()

def INT(): return int(eval(input()))

def MAP(): return list(map(int, input().split()))

def LIST(): return list(map(int, input().split()))

def ZIP(n): return list(zip(*(MAP() for _ in range(n))))

sys.setrecursionlimit(10 ** 9)

INF = float('inf')

mod = 10**9 + 7

from decimal import *

N = INT()

xy = []

for i in range(N):

	A = INT()

	xy.append([LIST() for _ in range(A)])

ans = 0

for i in range(1<<N):

	i = list("{:b}".format(i).zfill(N))

	for j in range(N):

		if i[j] == "1":

			for x, y in xy[j]:

				if y != int(i[x-1]):

					break

			else:

				continue

			break

	else:

		tmp = sum([int(x) for x in i])

		ans = max(ans, tmp)

print(ans)

# optimized version of the same code:

import sys, re

from collections import deque, defaultdict, Counter

from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2, log

from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby

from operator import itemgetter, mul

from copy import deepcopy

from string import ascii_lowercase, ascii_uppercase, digits

from bisect import bisect, bisect_left, insort, insort_left

from fractions import gcd

from heapq import heappush, heappop

from functools import reduce

from decimal import Decimal

def input(): return sys.stdin.readline().strip()

def INT(): return int(eval(input()))

def MAP(): return list(map(int, input().split()))

def LIST(): return list(map(int, input().split()))

def ZIP(n): return list(zip(*(MAP() for _ in range(n))))

sys.setrecursionlimit(10 ** 9)

INF = float('inf')

mod = 10**9 + 7

from decimal import *

N = INT()

xy = []

for i in range(N):

	A = INT()

	xy.append([LIST() for _ in range(A)])

ans = 0

for X in product((0, 1), repeat=N):

	for j in range(N):

		if X[j] == 1:

			for x, y in xy[j]:

				if X[x-1] != y:

					break

			else:

				continue

			break

	else:

		ans = max(ans, sum(X))

print(ans)

import sys, re
from collections import deque, defaultdict, Counter
from math import (
    ceil,
    sqrt,
    hypot,
    factorial,
    pi,
    sin,
    cos,
    tan,
    asin,
    acos,
    atan,
    radians,
    degrees,
)  # , log2, log
from itertools import (
    accumulate,
    permutations,
    combinations,
    combinations_with_replacement,
    product,
    groupby,
)
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
from decimal import Decimal

def input():
    return sys.stdin.readline().strip()

def INT():
    return int(eval(input()))

def MAP():
    return list(map(int, input().split()))

def LIST():
    return list(map(int, input().split()))

def ZIP(n):
    return list(zip(*(MAP() for _ in range(n))))

sys.setrecursionlimit(10**9)
INF = float("inf")
mod = 10**9 + 7
from decimal import *

N = INT()
xy = []
for i in range(N):
    A = INT()
    xy.append([LIST() for _ in range(A)])
ans = 0
for i in range(1 << N):
    i = list("{:b}".format(i).zfill(N))
    for j in range(N):
        if i[j] == "1":
            for x, y in xy[j]:
                if y != int(i[x - 1]):
                    break
            else:
                continue
            break
    else:
        tmp = sum([int(x) for x in i])
        ans = max(ans, tmp)
print(ans)

import sys, re
from collections import deque, defaultdict, Counter
from math import (
    ceil,
    sqrt,
    hypot,
    factorial,
    pi,
    sin,
    cos,
    tan,
    asin,
    acos,
    atan,
    radians,
    degrees,
)  # , log2, log
from itertools import (
    accumulate,
    permutations,
    combinations,
    combinations_with_replacement,
    product,
    groupby,
)
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
from decimal import Decimal

def input():
    return sys.stdin.readline().strip()

def INT():
    return int(eval(input()))

def MAP():
    return list(map(int, input().split()))

def LIST():
    return list(map(int, input().split()))

def ZIP(n):
    return list(zip(*(MAP() for _ in range(n))))

sys.setrecursionlimit(10**9)
INF = float("inf")
mod = 10**9 + 7
from decimal import *

N = INT()
xy = []
for i in range(N):
    A = INT()
    xy.append([LIST() for _ in range(A)])
ans = 0
for X in product((0, 1), repeat=N):
    for j in range(N):
        if X[j] == 1:
            for x, y in xy[j]:
                if X[x - 1] != y:
                    break
            else:
                continue
            break
    else:
        ans = max(ans, sum(X))
print(ans)

-    i = list("{:b}".format(i).zfill(N))


Input:
# 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:

w = eval(input())

y = list(set(w))

for i in range(len(y)):

    if w.count(y[i]) % 2 != 0:

        print('No')

        exit(0)

print('Yes')

# optimized version of the same code:

w = list(eval(input()))

x = list(set(w))

for i in x:

    y = w.count(i)

    if y % 2 != 0:

        print('No')

        exit(0)

print('Yes')

w = eval(input())
y = list(set(w))
for i in range(len(y)):
    if w.count(y[i]) % 2 != 0:
        print("No")
        exit(0)
print("Yes")

w = list(eval(input()))
x = list(set(w))
for i in x:
    y = w.count(i)
    if y % 2 != 0:
        print("No")
        exit(0)
print("Yes")

-w = eval(input())
-y = list(set(w))
-for i in range(len(y)):
-    if w.count(y[i]) % 2 != 0:
+w = list(eval(input()))
+x = list(set(w))
+for i in x:
+    y = w.count(i)
+    if y % 2 != 0:


Input:
# 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:

import numpy as np

from itertools import combinations

INF = int(1e9)*15

def main():

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

    a = np.array(input().split(), np.int32)

    c = np.array([int(i) for i in range(1, n)])

    ans = INF

    for comb in combinations(c, k-1):

        s = set(comb)

        mx = a[0]

        cost = 0

        for i in range(n):

            if i in s:

                if a[i] > mx:

                    mx = a[i]

                    continue

                else:

                    mx += 1

                    cost += mx-a[i]

                    continue

            mx = max(mx, a[i])

        ans = min(cost, ans)

    print(ans)

if __name__ == '__main__':

    main()

# optimized version of the same code:

from itertools import combinations

INF = int(1e9)*15

def main():

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

    a = [int(i) for i in input().split()]

    c = [int(i) for i in range(1, n)]

    ans = INF

    for comb in combinations(c, k-1):

        s = set(comb)

        mx = a[0]

        cost = 0

        for i in range(n):

            if i in s:

                if a[i] > mx:

                    mx = a[i]

                    continue

                else:

                    mx += 1

                    cost += mx-a[i]

                    continue

            mx = max(mx, a[i])

        ans = min(cost, ans)

    print(ans)

if __name__ == '__main__':

    main()

import numpy as np
from itertools import combinations

INF = int(1e9) * 15

def main():
    n, k = list(map(int, input().split()))
    a = np.array(input().split(), np.int32)
    c = np.array([int(i) for i in range(1, n)])
    ans = INF
    for comb in combinations(c, k - 1):
        s = set(comb)
        mx = a[0]
        cost = 0
        for i in range(n):
            if i in s:
                if a[i] > mx:
                    mx = a[i]
                    continue
                else:
                    mx += 1
                    cost += mx - a[i]
                    continue
            mx = max(mx, a[i])
        ans = min(cost, ans)
    print(ans)

if __name__ == "__main__":
    main()

from itertools import combinations

INF = int(1e9) * 15

def main():
    n, k = list(map(int, input().split()))
    a = [int(i) for i in input().split()]
    c = [int(i) for i in range(1, n)]
    ans = INF
    for comb in combinations(c, k - 1):
        s = set(comb)
        mx = a[0]
        cost = 0
        for i in range(n):
            if i in s:
                if a[i] > mx:
                    mx = a[i]
                    continue
                else:
                    mx += 1
                    cost += mx - a[i]
                    continue
            mx = max(mx, a[i])
        ans = min(cost, ans)
    print(ans)

if __name__ == "__main__":
    main()

-    a = np.array(input().split(), np.int32)

-    c = np.array([int(i) for i in range(1, n)])

+    a = [int(i) for i in input().split()]


Input:
# 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:

import sys

import numpy as np

sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))

N = ir()

A = np.array(lr())

A = A[A%2==0].tolist()

bool = True

for a in A:

    if a%3 != 0 and a%5 != 0:

        bool = False

print(('APPROVED' if bool else 'DENIED'))

# optimized version of the same code:

# coding: utf-8

import sys

sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))

N = ir()

A = lr()

bl = all(x % 3 == 0 or x % 5 == 0 for x in A if x % 2 == 0)

print(('APPROVED' if bl else 'DENIED'))

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
A = np.array(lr())
A = A[A % 2 == 0].tolist()
bool = True
for a in A:
    if a % 3 != 0 and a % 5 != 0:
        bool = False
print(("APPROVED" if bool else "DENIED"))

# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
A = lr()
bl = all(x % 3 == 0 or x % 5 == 0 for x in A if x % 2 == 0)
print(("APPROVED" if bl else "DENIED"))

-print(("APPROVED" if bool else "DENIED"))

+bl = all(x % 3 == 0 or x % 5 == 0 for x in A if x % 2 == 0)

+print(("APPROVED" if bl else "DENIED"))


Input:
# 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:

from collections import defaultdict

N, K, *A = list(map(int, open(0).read().split()))

S = [0] * (N + 1)

for i in range(N):

    S[i + 1] = S[i] + A[i]

d = defaultdict(int)

ans = 0

for j in range(N + 1):

    v = (S[j] - j) % K

    ans += d[v]

    d[v] += 1

    if j >= K - 1:

        d[(S[j - K + 1] - (j - K + 1)) % K] -= 1

print(ans)

# optimized version of the same code:

from collections import defaultdict

N, K, *A = list(map(int, open(0).read().split()))

x = [0] * (N + 1)

for i in range(N):

    x[i + 1] = x[i] + A[i]

y = [(x[i] - i) % K for i in range(N + 1)]

ctr = defaultdict(int)

ans = 0

for j in range(N + 1):

    ans += ctr[y[j]]

    ctr[y[j]] += 1

    if j - K + 1 >= 0:

        ctr[y[j - K + 1]] -= 1

print(ans)

+y = [(x[i] - i) % K for i in range(N + 1)]


Input:
# 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()))

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

x.sort()

for p in range(x[0],x[len(x)-1]+1):

    psum=0

    for i in range(len(x)):

        psum=psum+(x[0]-x[i])**2

#    print(psum)

    pmin=psum

    for j in range(x[0]+1,x[len(x)-1]):

        psum=0

        for i in range(len(x)):

            psum=psum+(j-x[i])**2

#        print(psum)

        if pmin>psum:

            pmin=psum

print(pmin)

# optimized version of the same code:

n=int(eval(input()))

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

x.sort()

psum=0

for i in range(len(x)):

    psum=psum+(x[0]-x[i])**2

#    print(psum)

pmin=psum

for j in range(x[0]+1,x[len(x)-1]):

    psum=0

    for i in range(len(x)):

        psum=psum+(j-x[i])**2

#        print(psum)

    if pmin>psum:

        pmin=psum

print(pmin)

n = int(eval(input()))
x = list(map(int, input().split()))
x.sort()
for p in range(x[0], x[len(x) - 1] + 1):
    psum = 0
    for i in range(len(x)):
        psum = psum + (x[0] - x[i]) ** 2
    #    print(psum)
    pmin = psum
    for j in range(x[0] + 1, x[len(x) - 1]):
        psum = 0
        for i in range(len(x)):
            psum = psum + (j - x[i]) ** 2
        #        print(psum)
        if pmin > psum:
            pmin = psum
print(pmin)

n = int(eval(input()))
x = list(map(int, input().split()))
x.sort()
psum = 0
for i in range(len(x)):
    psum = psum + (x[0] - x[i]) ** 2
#    print(psum)
pmin = psum
for j in range(x[0] + 1, x[len(x) - 1]):
    psum = 0
    for i in range(len(x)):
        psum = psum + (j - x[i]) ** 2
    #        print(psum)
    if pmin > psum:
        pmin = psum
print(pmin)

-for p in range(x[0], x[len(x) - 1] + 1):

+for j in range(x[0] + 1, x[len(x) - 1]):

-    for j in range(x[0] + 1, x[len(x) - 1]):

-            psum = psum + (j - x[i]) ** 2


Input:
# 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()))

# N>81のときはn*nで表せないので不敵

if N>81:

    print('No')

else:

    import numpy as np

    n=np.array([1,2,3,4,5,6,7,8,9])

    amari=N%n

    shou=N//n

    if np.any((amari==0)*(shou<=9)):

        print('Yes')

    else:

        print('No')

# optimized version of the same code:

N = int(eval(input()))

for i in range(1,10):

    if not N%i == 0:

        continue

    rest = N/i

    if rest<10:

        print('Yes')

        exit()

print('No')

N = int(eval(input()))
# N>81のときはn*nで表せないので不敵
if N > 81:
    print("No")
else:
    import numpy as np

    n = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9])
    amari = N % n
    shou = N // n
    if np.any((amari == 0) * (shou <= 9)):
        print("Yes")
    else:
        print("No")

N = int(eval(input()))
for i in range(1, 10):
    if not N % i == 0:
        continue
    rest = N / i
    if rest < 10:
        print("Yes")
        exit()
print("No")

-# N>81のときはn*nで表せないので不敵

-    if np.any((amari == 0) * (shou <= 9)):


Input:
# 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:

import numpy as np

import math

def bigger_devisor(n):

  s = np.sqrt(n)

  i = math.ceil(s)

  while(n % i != 0):

    i += 1

  return i

n = int(eval(input()))

if bigger_devisor(n) > 9:

  print('No')

else:

  print('Yes')

# optimized version of the same code:

n = int(eval(input()))

ans = 0

for i in range(1, 10):

  if n % i == 0:

    if n / i < 10:

      ans = 1

if ans == 0:

  print('No')

else:

  print('Yes')

import numpy as np
import math

def bigger_devisor(n):
    s = np.sqrt(n)
    i = math.ceil(s)
    while n % i != 0:
        i += 1
    return i

n = int(eval(input()))
if bigger_devisor(n) > 9:
    print("No")
else:
    print("Yes")

n = int(eval(input()))
ans = 0
for i in range(1, 10):
    if n % i == 0:
        if n / i < 10:
            ans = 1
if ans == 0:
    print("No")
else:
    print("Yes")

-import numpy as np
-import math
-def bigger_devisor(n):
-    s = np.sqrt(n)
-    i = math.ceil(s)
-    while n % i != 0:
-        i += 1
-    return i
-if bigger_devisor(n) > 9:
+ans = 0
+for i in range(1, 10):
+    if n % i == 0:
+        if n / i < 10:
+            ans = 1
+if ans == 0:


Input:
# 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, k = list(map(int, input().split()))

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

mod = 10 ** 9 + 7

dp = [[0] * (k + 1) for _ in range(n + 1)]

dp[0][0] = 1

for i in range(n):

    dp[i + 1][0] = dp[i][0]

    for j in range(1, k+1):

        dp[i + 1][j] = (dp[i + 1][j - 1] + dp[i][j]) % mod

    for j in range(k, a[i], -1):

        dp[i + 1][j] = (dp[i + 1][j] - dp[i + 1][j - a[i] - 1]) % mod

print((dp[n][-1]))

# optimized version of the same code:

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

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

mod = 10 ** 9 + 7

f = [0] * (k + 1)

f[0] = 1

for i in range(n):

    for j in range(1, k+1):

        f[j] = (f[j] + f[j - 1]) % mod # 1/(1-x):累積和

    for j in range(k, a[i], -1): # 1-x^(a[i]+1) a[i]+1次したの項を引く

        f[j] = (f[j] - f[j - a[i] - 1]) % mod

print((f[-1]))

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 10**9 + 7
f = [0] * (k + 1)
f[0] = 1
for i in range(n):
    for j in range(1, k + 1):
        f[j] = (f[j] + f[j - 1]) % mod  # 1/(1-x):累積和
    for j in range(k, a[i], -1):  # 1-x^(a[i]+1) a[i]+1次したの項を引く
        f[j] = (f[j] - f[j - a[i] - 1]) % mod
print((f[-1]))

+    for j in range(k, a[i], -1):  # 1-x^(a[i]+1) a[i]+1次したの項を引く


Input:
# 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:

import re

S = eval(input())

max = 0

for i in range(len(S)) :

    for j in range(i + 1, len(S) + 1) :

        pattern = re.compile(r'[A|T|C|G]{%d}' % int(j - i))

        subStr = S[i:j]

        if pattern.match(subStr) and j - i > max :

            max = j - i

print(max)

# optimized version of the same code:

S = eval(input())

ans = 0

for i in range(len(S)) :

    for j in range(i, len(S)) :

        if all('ACGT'.count(c) == 1 for c in S[i : j + 1]) :

            ans = max(ans, j - i + 1)

print(ans)

import re

S = eval(input())
max = 0
for i in range(len(S)):
    for j in range(i + 1, len(S) + 1):
        pattern = re.compile(r"[A|T|C|G]{%d}" % int(j - i))
        subStr = S[i:j]
        if pattern.match(subStr) and j - i > max:
            max = j - i
print(max)

S = eval(input())
ans = 0
for i in range(len(S)):
    for j in range(i, len(S)):
        if all("ACGT".count(c) == 1 for c in S[i : j + 1]):
            ans = max(ans, j - i + 1)
print(ans)

-        pattern = re.compile(r"[A|T|C|G]{%d}" % int(j - i))

-        if pattern.match(subStr) and j - i > max:

+        if all("ACGT".count(c) == 1 for c in S[i : j + 1]):


Input:
# 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:

import itertools

N = int(eval(input()))

Nketa = len(str(N))

range_count = [[0 for j in range(10)]for i in range(10)]

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

    mae = int(str(p)[0])

    ato = int(str(p)[-1])

    range_count[mae][ato] += 1

count = 0

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

    a_mae = int(str(j)[0])

    a_ato = int(str(j)[-1])

    b_mae = a_ato

    b_ato = a_mae

    if b_mae == 0:

        continue

    else:

        count += range_count[b_mae][b_ato]

print(count)

# optimized version of the same code:

n = int(eval(input()))

all_count = 0

options = [str(i) for i in range(10)]

maeato = [[0 for i in range(10)] for j in range(10)]

for i in range(n+1):

    checking = str(i)

    maeato[int(checking[0])][int(checking[-1])]+=1

all_count = 0

for i in range(1,10):

    for j in range(1,10):

        for k in range(1,10):

            for p in range(1,10):

                if i == p and j == k:

                    all_count+=maeato[i][j]*maeato[k][p]

print(all_count)

import itertools

N = int(eval(input()))
Nketa = len(str(N))
range_count = [[0 for j in range(10)] for i in range(10)]
for p in range(1, N + 1):
    mae = int(str(p)[0])
    ato = int(str(p)[-1])
    range_count[mae][ato] += 1
count = 0
for j in range(1, N + 1):
    a_mae = int(str(j)[0])
    a_ato = int(str(j)[-1])
    b_mae = a_ato
    b_ato = a_mae
    if b_mae == 0:
        continue
    else:
        count += range_count[b_mae][b_ato]
print(count)

n = int(eval(input()))
all_count = 0
options = [str(i) for i in range(10)]
maeato = [[0 for i in range(10)] for j in range(10)]
for i in range(n + 1):
    checking = str(i)
    maeato[int(checking[0])][int(checking[-1])] += 1
all_count = 0
for i in range(1, 10):
    for j in range(1, 10):
        for k in range(1, 10):
            for p in range(1, 10):
                if i == p and j == k:
                    all_count += maeato[i][j] * maeato[k][p]
print(all_count)

-range_count = [[0 for j in range(10)] for i in range(10)]

-        count += range_count[b_mae][b_ato]

+maeato = [[0 for i in range(10)] for j in range(10)]

+    maeato[int(checking[0])][int(checking[-1])] += 1

+                    all_count += maeato[i][j] * maeato[k][p]


Input:
# 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:

H, W = list(map(int, input().split()))

import numpy as np

Grid = np.array([[0 if x == '.' else -1 for x in eval(input())] for _ in range(H)],dtype='int64')

def solveMase(Grid, start, goal): #bfsで迷路を解き、スタート-ゴール間の最低必要白マス数を返す

    seen = {start}

    V = [start]

    while len(V) != 0: #bfs

        v = V.pop(0)

        if v == goal:

            return Grid[goal]

        #移動先nvをリストにまとめる

        y,x = v

        nV = []

        if x > 0: nV.append((y,x-1))

        if y > 0: nV.append((y-1,x))

        if x < W-1: nV.append((y,x+1))

        if y < H-1: nV.append((y+1,x))

        #bfs

        for nv in nV:

            if Grid[nv] == -1 or nv in seen:

                continue

            Grid[nv] = Grid[v] + 1

            V.append(nv)

            seen.add(nv)

    return 0

white = len(Grid[Grid == 0])-1

nes_white = solveMase(Grid, (0,0), (H-1,W-1))

print((white-nes_white if nes_white > 0 else -1))

# optimized version of the same code:

from collections import deque, Counter

def main():

    with open(0) as f:

        H, W = list(map(int, f.readline().split()))

        maze = [list(line) for line in f.readlines()]

    rank = [[None]*W for _ in range(H)]

    rank[0][0] = 0

    #bfs

    reserved = deque([(0,0)])

    while len(reserved) > 0:

        x, y = reserved.popleft()

        for u,v in [(s,t) for s,t in [(x-1,y), (x+1,y), (x,y-1), (x,y+1)] if 0<=s<H and 0<=t<W]:

            if rank[u][v] is not None:

                continue

            if maze[u][v] == '.':

                rank[u][v] = rank[x][y] + 1

                reserved.append((u,v))

    if rank[H-1][W-1] is None:

        print((-1))

    else:

        counter = Counter()

        for line in maze:

            counter.update(line)

        print((counter['.'] - rank[H-1][W-1]-1))

main()

H, W = list(map(int, input().split()))
import numpy as np

Grid = np.array(
    [[0 if x == "." else -1 for x in eval(input())] for _ in range(H)], dtype="int64"
)

def solveMase(Grid, start, goal):  # bfsで迷路を解き、スタート-ゴール間の最低必要白マス数を返す
    seen = {start}
    V = [start]
    while len(V) != 0:  # bfs
        v = V.pop(0)
        if v == goal:
            return Grid[goal]
        # 移動先nvをリストにまとめる
        y, x = v
        nV = []
        if x > 0:
            nV.append((y, x - 1))
        if y > 0:
            nV.append((y - 1, x))
        if x < W - 1:
            nV.append((y, x + 1))
        if y < H - 1:
            nV.append((y + 1, x))
        # bfs
        for nv in nV:
            if Grid[nv] == -1 or nv in seen:
                continue
            Grid[nv] = Grid[v] + 1
            V.append(nv)
            seen.add(nv)
    return 0

white = len(Grid[Grid == 0]) - 1
nes_white = solveMase(Grid, (0, 0), (H - 1, W - 1))
print((white - nes_white if nes_white > 0 else -1))

from collections import deque, Counter

def main():
    with open(0) as f:
        H, W = list(map(int, f.readline().split()))
        maze = [list(line) for line in f.readlines()]
    rank = [[None] * W for _ in range(H)]
    rank[0][0] = 0
    # bfs
    reserved = deque([(0, 0)])
    while len(reserved) > 0:
        x, y = reserved.popleft()
        for u, v in [
            (s, t)
            for s, t in [(x - 1, y), (x + 1, y), (x, y - 1), (x, y + 1)]
            if 0 <= s < H and 0 <= t < W
        ]:
            if rank[u][v] is not None:
                continue
            if maze[u][v] == ".":
                rank[u][v] = rank[x][y] + 1
                reserved.append((u, v))
    if rank[H - 1][W - 1] is None:
        print((-1))
    else:
        counter = Counter()
        for line in maze:
            counter.update(line)
        print((counter["."] - rank[H - 1][W - 1] - 1))

main()

-    [[0 if x == "." else -1 for x in eval(input())] for _ in range(H)], dtype="int64"

-def solveMase(Grid, start, goal):  # bfsで迷路を解き、スタート-ゴール間の最低必要白マス数を返す

-        # 移動先nvをリストにまとめる

-            if Grid[nv] == -1 or nv in seen:

+        H, W = list(map(int, f.readline().split()))

+        maze = [list(line) for line in f.readlines()]

+    rank = [[None] * W for _ in range(H)]

+            if 0 <= s < H and 0 <= t < W

+                rank[u][v] = rank[x][y] + 1

+                reserved.append((u, v))

-nes_white = solveMase(Grid, (0, 0), (H - 1, W - 1))

-print((white - nes_white if nes_white > 0 else -1))


Input:
# 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:

import numpy as np

N = int(eval(input()))

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

A = list(np.array(A) - 1)

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

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

sum_ = 0

diff = list(np.array(A[1:]) - np.array(A[:-1]))

diff.insert(0, -1)

for i in range(N):

  sum_ += B[A[i]]

  if diff[i] == 1:

    sum_ += C[A[i-1]]

print(sum_)

# optimized version of the same code:

N = int(eval(input()))

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

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

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

ans = 0

for i in range(len(A)):

  ans += B[A[i]-1]

  if i != 0:

    if A[i-1] + 1 == A[i]:

      ans += C[A[i-1]-1]

print(ans)

import numpy as np

N = int(eval(input()))
A = list(map(int, input().split()))
A = list(np.array(A) - 1)
B = list(map(int, input().split()))
C = list(map(int, input().split()))
sum_ = 0
diff = list(np.array(A[1:]) - np.array(A[:-1]))
diff.insert(0, -1)
for i in range(N):
    sum_ += B[A[i]]
    if diff[i] == 1:
        sum_ += C[A[i - 1]]
print(sum_)

N = int(eval(input()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0
for i in range(len(A)):
    ans += B[A[i] - 1]
    if i != 0:
        if A[i - 1] + 1 == A[i]:
            ans += C[A[i - 1] - 1]
print(ans)

-diff = list(np.array(A[1:]) - np.array(A[:-1]))


Input:
# 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, W = list(map(int, input().split()))

items = sorted([list(map(int, input().split())) for i in range(N)])

# dp1[i][j] := 商品0 ~ i が対象

dp = [[0] * (W + 1) for i in range(N + 1)]

# dpテーブルを埋める

for i in range(N):

    wi, vi = items[i]

    for j in range(W + 1):

        if j + wi <= W:

            dp[i + 1][j + wi] = max(dp[i + 1][j + wi], dp[i][j] + vi)

        dp[i + 1][j] = max(dp[i][j], dp[i + 1][j])

ans = 0

for i, (wi, vi) in enumerate(items):

    for j in range(W):

        ans = max(ans, dp[i][j] + vi)

print(ans)

# optimized version of the same code:

N, W = list(map(int, input().split()))

items = sorted([list(map(int, input().split())) for i in range(N)])

# dp1[i][j] := 商品0 ~ i が対象

dp = [[0] * (W + 1) for i in range(N + 1)]

# dpテーブルを埋める

for i in range(N):

    wi, vi = items[i]

    for j in range(W + 1):

        if j + wi <= W:

            dp[i + 1][j + wi] = max(dp[i + 1][j + wi], dp[i][j] + vi)

        dp[i + 1][j] = max(dp[i][j], dp[i + 1][j])

ans = 0

for i, (wi, vi) in enumerate(items):

    ans = max(ans, dp[i][W - 1] + vi)

print(ans)

-    for j in range(W):
-        ans = max(ans, dp[i][j] + vi)
+    ans = max(ans, dp[i][W - 1] + vi)


Input:
# 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:

x = int(eval(input()))

for a in range(-118, 120):

    for b in range(-119, 119):

        if a**5-b**5 == x:

            print((a, b))

            exit()

# optimized version of the same code:

x = int(eval(input()))

for a in range(1, 120):

    for b in range(-119, 119):

        if a**5-b**5 == x:

            print((a, b))

            exit()

x = int(eval(input()))
for a in range(-118, 120):
    for b in range(-119, 119):
        if a**5 - b**5 == x:
            print((a, b))
            exit()

x = int(eval(input()))
for a in range(1, 120):
    for b in range(-119, 119):
        if a**5 - b**5 == x:
            print((a, b))
            exit()

-for a in range(-118, 120):
+for a in range(1, 120):


Input:
# 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:

s=eval(input())

t=eval(input())

ans=0

if s[0]==t[0]:

    ans+=1

if s[1]==t[1]:

    ans+=1

if s[2]==t[2]:

    ans+=1

print(ans)

# optimized version of the same code:

s=eval(input())

t=eval(input())

ans=0

for i in range(0,3):

    if s[i]==t[i]:

        ans+=1

print(ans)

s = eval(input())
t = eval(input())
ans = 0
if s[0] == t[0]:
    ans += 1
if s[1] == t[1]:
    ans += 1
if s[2] == t[2]:
    ans += 1
print(ans)

s = eval(input())
t = eval(input())
ans = 0
for i in range(0, 3):
    if s[i] == t[i]:
        ans += 1
print(ans)


Input:
# 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:

# https://atcoder.jp/contests/abc129/tasks/abc129_c

# 典型的なDP

MOD = 10**9 + 7

import numpy as np

# dp[i]をi段目までの通りの数とする。

N, M = list(map(int, input().split()))

to_zero = np.full((N + 1), False, dtype=bool)

for _ in range(M):

    to_zero[int(eval(input()))] = True  # 床が抜けているところ

# dpテーブルの用意

dp = np.full((N + 1), -1, dtype='int64')

dp[0] = 1

dp[1] = 0 if to_zero[1] else 1

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

    dp[i] = 0 if to_zero[i] else dp[i - 2] + dp[i - 1]

    if dp[i] > MOD:

        dp[i] %= MOD

print((dp[-1]))

# optimized version of the same code:

# https://atcoder.jp/contests/abc129/tasks/abc129_c

# 典型的なDP

MOD = 10**9 + 7

import numpy as np

# dp[i]をi段目までの通りの数とする。

N, M = list(map(int, input().split()))

to_zero = np.full((N + 1), False).tolist()

for _ in range(M):

    to_zero[int(eval(input()))] = True  # 床が抜けているところ

# dpテーブルの用意

dp = np.full((N + 1), -1).tolist()

dp[0] = 1

dp[1] = 0 if to_zero[1] else 1

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

    dp[i] = 0 if to_zero[i] else dp[i - 2] + dp[i - 1]

    if dp[i] > MOD:

        dp[i] %= MOD

print((dp[-1]))

# https://atcoder.jp/contests/abc129/tasks/abc129_c
# 典型的なDP
MOD = 10**9 + 7
import numpy as np

# dp[i]をi段目までの通りの数とする。
N, M = list(map(int, input().split()))
to_zero = np.full((N + 1), False, dtype=bool)
for _ in range(M):
    to_zero[int(eval(input()))] = True  # 床が抜けているところ
# dpテーブルの用意
dp = np.full((N + 1), -1, dtype="int64")
dp[0] = 1
dp[1] = 0 if to_zero[1] else 1
for i in range(2, N + 1):
    dp[i] = 0 if to_zero[i] else dp[i - 2] + dp[i - 1]
    if dp[i] > MOD:
        dp[i] %= MOD
print((dp[-1]))

-to_zero = np.full((N + 1), False, dtype=bool)

+to_zero = np.full((N + 1), False).tolist()


Input:
# 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:

import numpy as np

eval(input())

x = np.array(input().split(),dtype=np.int32)

ans = 0

while (x%2 == 0).all():

  x = x//2

  ans += 1

print(ans)

# optimized version of the same code:

N = int(eval(input()))

A = [int(x) for x in input().split()]

result = float('inf')

for i in range(N):

  r=0

  while A[i]%2==0:

    A[i]=A[i]/2

    r +=1

  result=min(result,r)

print(result)

import numpy as np

eval(input())
x = np.array(input().split(), dtype=np.int32)
ans = 0
while (x % 2 == 0).all():
    x = x // 2
    ans += 1
print(ans)

N = int(eval(input()))
A = [int(x) for x in input().split()]
result = float("inf")
for i in range(N):
    r = 0
    while A[i] % 2 == 0:
        A[i] = A[i] / 2
        r += 1
    result = min(result, r)
print(result)

-x = np.array(input().split(), dtype=np.int32)


Input:
# 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 = {} #10000以上key以下の回文数の個数

cnt = 0

for i in range(10000, 100000):

    L = list(str(i))

    if L == list(reversed(L)):

        cnt += 1

    N[i] = cnt

A, B = list(map(int, input().split()))

print((N[B]-N[A-1] if A > 10000 else N[B]))

# optimized version of the same code:

A, B =list(map(int, input().split()))

num_palin = [0] * (B+1)

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

    if str(i) == str(i)[::-1]:

        num_palin[i] = num_palin[i-1] + 1

    else:

        num_palin[i] = num_palin[i-1]

print((num_palin[B]-num_palin[A-1]))

N = {}  # 10000以上key以下の回文数の個数
cnt = 0
for i in range(10000, 100000):
    L = list(str(i))
    if L == list(reversed(L)):
        cnt += 1
    N[i] = cnt
A, B = list(map(int, input().split()))
print((N[B] - N[A - 1] if A > 10000 else N[B]))

A, B = list(map(int, input().split()))
num_palin = [0] * (B + 1)
for i in range(1, B + 1):
    if str(i) == str(i)[::-1]:
        num_palin[i] = num_palin[i - 1] + 1
    else:
        num_palin[i] = num_palin[i - 1]
print((num_palin[B] - num_palin[A - 1]))

+        num_palin[i] = num_palin[i - 1] + 1

+        num_palin[i] = num_palin[i - 1]

+print((num_palin[B] - num_palin[A - 1]))


Input:
# 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:

k,s=list(map(int,input().split()))

cnt=0

for i in range(k+1):

    for j in range(k+1):

        if 0 <= s-i-j <= k:

            cnt+=1

print(cnt)

# optimized version of the same code:

k,s=list(map(int,input().split()))

a=0

for i in range(0,k+1):

    for j in range(0,k+1):

        if 0<=s-i-j<=k:

            a+=1

print(a)

k, s = list(map(int, input().split()))
cnt = 0
for i in range(k + 1):
    for j in range(k + 1):
        if 0 <= s - i - j <= k:
            cnt += 1
print(cnt)

k, s = list(map(int, input().split()))
a = 0
for i in range(0, k + 1):
    for j in range(0, k + 1):
        if 0 <= s - i - j <= k:
            a += 1
print(a)

-cnt = 0
-for i in range(k + 1):
-    for j in range(k + 1):
+a = 0
+for i in range(0, k + 1):
+    for j in range(0, k + 1):
-            cnt += 1
-print(cnt)
+            a += 1
+print(a)


Input:
# 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,Ma,Mb = list(map(int, input().split()))

arr=[list(map(int,input().split())) for _ in range(N)]

dp=[[[5000]*401 for _ in range(401)] for _ in range(41)]

dp[0][0][0] = 0

for i in range(N):

    a,b,c=arr[i]

    for j in range(10*N+1):

        for k in range(10*N+1):

            if dp[i][j][k] == 5000:

                continue

            dp[i+1][j][k]=min(dp[i+1][j][k],dp[i][j][k])

            dp[i+1][j+a][k+b]=min(dp[i+1][j+a][k+b],dp[i][j][k]+c)

ans=5000

for i in range(1,401):

        if i*Ma>400 or i*Mb>400:

            break

        ans = min(ans, dp[N][i*Ma][i*Mb])

if ans == 5000:

    print((-1))

else:

    print(ans)

# optimized version of the same code:

def calc():

    N,Ma,Mb = list(map(int, input().split()))

    arr=[list(map(int,input().split())) for _ in range(N)]

    dp=[[[5000]*401 for _ in range(401)] for _ in range(41)]

    dp[0][0][0] = 0

    for i in range(N):

        a,b,c=arr[i]

        for j in range(10*N+1):

            for k in range(10*N+1):

                if dp[i][j][k] == 5000:

                    continue

                dp[i+1][j][k]=min(dp[i+1][j][k],dp[i][j][k])

                dp[i+1][j+a][k+b]=min(dp[i+1][j+a][k+b],dp[i][j][k]+c)

    ans=5000

    for i in range(1,401):

            if i*Ma>400 or i*Mb>400:

                break

            ans = min(ans, dp[N][i*Ma][i*Mb])

    if ans == 5000:

        print((-1))

    else:

        print(ans)

calc()

def calc():
    N, Ma, Mb = list(map(int, input().split()))
    arr = [list(map(int, input().split())) for _ in range(N)]
    dp = [[[5000] * 401 for _ in range(401)] for _ in range(41)]
    dp[0][0][0] = 0
    for i in range(N):
        a, b, c = arr[i]
        for j in range(10 * N + 1):
            for k in range(10 * N + 1):
                if dp[i][j][k] == 5000:
                    continue
                dp[i + 1][j][k] = min(dp[i + 1][j][k], dp[i][j][k])
                dp[i + 1][j + a][k + b] = min(dp[i + 1][j + a][k + b], dp[i][j][k] + c)
    ans = 5000
    for i in range(1, 401):
        if i * Ma > 400 or i * Mb > 400:
            break
        ans = min(ans, dp[N][i * Ma][i * Mb])
    if ans == 5000:
        print((-1))
    else:
        print(ans)

calc()

-N, Ma, Mb = list(map(int, input().split()))

-arr = [list(map(int, input().split())) for _ in range(N)]

-    ans = min(ans, dp[N][i * Ma][i * Mb])

+    N, Ma, Mb = list(map(int, input().split()))

+    arr = [list(map(int, input().split())) for _ in range(N)]

+            for k in range(10 * N + 1):

+        ans = min(ans, dp[N][i * Ma][i * Mb])


Input:
# 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:

# ワーシャルフロイドで、各町間の最短距離の更新は200^3 = 8,000,000

# 訪れるべき町Rはたかだか8個なので、順番の全通りを試して8! = 約40000通り

import numpy as np

from scipy.sparse.csgraph import shortest_path, floyd_warshall

from scipy.sparse import csr_matrix

N,M,R = list(map(int,input().split()))

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

r = list([x-1 for x in r])

E = [[0 for j in range(N)] for i in range(N)]

for i in range(M):

  a,b,c = list(map(int,input().split()))

  E[a-1][b-1] = c

  E[b-1][a-1] = c

E = np.array(E)

E = shortest_path(E,method = "FW")

# DFSですべての数を試す

stack = []

for i in range(len(r)):

  stack.append([r[i],[],0])

ans = 10 ** 18

while stack:

  v,visited,dist = stack.pop()

  if len(visited) != 0:

    dist += E[visited[-1]][v]

  visited2 = visited.copy()

  visited2.append(v)

  if len(visited2) == len(r):

    if dist < ans:

      ans = dist

    continue

  for i in range(len(r)):

    if r[i] not in visited2:

      stack.append([r[i],visited2,dist])

print((int(ans)))

# optimized version of the same code:

import sys

readline = sys.stdin.readline

N,M,R = list(map(int,readline().split()))

r = list(map(int,readline().split()))

INF = 10 ** 10

G = [[INF] * N for i in range(N)]

for i in range(M):

  a,b,c = list(map(int,readline().split()))

  G[a - 1][b - 1] = c

  G[b - 1][a - 1] = c

for i in range(N):

  G[i][i] = 0

for k in range(N):

  for i in range(N):

    for j in range(N):

      G[i][j] = min(G[i][j], G[i][k] + G[k][j])

import itertools

ans = INF

for perm in itertools.permutations(list(range(R))):

  dist = 0

  for i in range(1, len(perm)):

    dist += G[r[perm[i - 1]] - 1][r[perm[i]] - 1]

  if ans > dist:

    ans = dist

print(ans)

# ワーシャルフロイドで、各町間の最短距離の更新は200^3 = 8,000,000
# 訪れるべき町Rはたかだか8個なので、順番の全通りを試して8! = 約40000通り
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall
from scipy.sparse import csr_matrix

N, M, R = list(map(int, input().split()))
r = list(map(int, input().split()))
r = list([x - 1 for x in r])
E = [[0 for j in range(N)] for i in range(N)]
for i in range(M):
    a, b, c = list(map(int, input().split()))
    E[a - 1][b - 1] = c
    E[b - 1][a - 1] = c
E = np.array(E)
E = shortest_path(E, method="FW")
# DFSですべての数を試す
stack = []
for i in range(len(r)):
    stack.append([r[i], [], 0])
ans = 10**18
while stack:
    v, visited, dist = stack.pop()
    if len(visited) != 0:
        dist += E[visited[-1]][v]
    visited2 = visited.copy()
    visited2.append(v)
    if len(visited2) == len(r):
        if dist < ans:
            ans = dist
        continue
    for i in range(len(r)):
        if r[i] not in visited2:
            stack.append([r[i], visited2, dist])
print((int(ans)))

import sys

readline = sys.stdin.readline
N, M, R = list(map(int, readline().split()))
r = list(map(int, readline().split()))
INF = 10**10
G = [[INF] * N for i in range(N)]
for i in range(M):
    a, b, c = list(map(int, readline().split()))
    G[a - 1][b - 1] = c
    G[b - 1][a - 1] = c
for i in range(N):
    G[i][i] = 0
for k in range(N):
    for i in range(N):
        for j in range(N):
            G[i][j] = min(G[i][j], G[i][k] + G[k][j])
import itertools

ans = INF
for perm in itertools.permutations(list(range(R))):
    dist = 0
    for i in range(1, len(perm)):
        dist += G[r[perm[i - 1]] - 1][r[perm[i]] - 1]
    if ans > dist:
        ans = dist
print(ans)

-# ワーシャルフロイドで、各町間の最短距離の更新は200^3 = 8,000,000

-# 訪れるべき町Rはたかだか8個なので、順番の全通りを試して8! = 約40000通り

-from scipy.sparse.csgraph import shortest_path, floyd_warshall

-N, M, R = list(map(int, input().split()))

-E = [[0 for j in range(N)] for i in range(N)]

+N, M, R = list(map(int, readline().split()))

-    a, b, c = list(map(int, input().split()))

-# DFSですべての数を試す

-            stack.append([r[i], visited2, dist])

+    a, b, c = list(map(int, readline().split()))

+for perm in itertools.permutations(list(range(R))):


Input:
# 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:

def main():

    x = int(eval(input()))

    for a in range(-120, 121):

        for b in range(-120, 121):

            if a**5 - b**5 == x:

                print((a, b))

                return

if __name__ == "__main__":

    main()

# optimized version of the same code:

def main():

    x = int(eval(input()))

    for i in range(-120, 121):

        for j in range(-120, 121):

            if i**5 - j**5 == x:

                print((i, j))

                return

if __name__ == "__main__":

    main()


Input:
# 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:

from fractions import gcd

N, M = list(map(int, input().split()))

A = list([int(x) for x in input().split()])

cnt = [0 for _ in range(N)]

for i in range(N):

  a = A[i]

  while a%2 == 0:

    a = a // 2

    cnt[i] += 1

if max(cnt) > min(cnt):

  print((0))

  exit(0)

C = max(cnt)

A = list([x // pow(2,C) for x in A])

def gcd(a,b):

  if a<b:

    a,b = b,a

  while a%b > 0:

    a,b = b,a%b

  return b

def lcm(a,b):

  return a*b//gcd(a,b)

x = A[0]

for a in A[1:]:

  x = lcm(x,a)

x = x * pow(2,C-1)

print(((M // x + 1) // 2))

# optimized version of the same code:

from fractions import gcd

N, M = list(map(int, input().split()))
A = list([int(x) for x in input().split()])
cnt = [0 for _ in range(N)]
for i in range(N):
    a = A[i]
    while a % 2 == 0:
        a = a // 2
        cnt[i] += 1
if max(cnt) > min(cnt):
    print((0))
    exit(0)
C = max(cnt)
A = list([x // pow(2, C) for x in A])

def gcd(a, b):
    if a < b:
        a, b = b, a
    while a % b > 0:
        a, b = b, a % b
    return b

def lcm(a, b):
    return a * b // gcd(a, b)

x = A[0]
for a in A[1:]:
    x = lcm(x, a)
x = x * pow(2, C - 1)
print(((M // x + 1) // 2))


Input:
# 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:

from heapq import *

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

PAIRS = [[-a, -1] for a in map(int, input().split())]

heapify(PAIRS)

for _ in range(m):

    b, c = list(map(int, input().split()))

    heappush(PAIRS, [-c, -b])

answer = 0

for _ in range(n):

    pair = heappop(PAIRS)

    answer += -pair[0]

    pair[1] += 1

    if pair[1] != 0:

        heappush(PAIRS, pair)

print(answer)

# optimized version of the same code:

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

PAIRS = [(a, 1) for a in map(int, input().split())]

for _ in range(m):

    b, c = list(map(int, input().split()))

    PAIRS.append((c, b))

PAIRS.sort(reverse = True)

answer, count = 0, 0

for pair in PAIRS:

    answer += pair[0] * pair[1]

    count += pair[1]

    if count > n:

        answer -= pair[0] * (count - n)

        break

print(answer)

n, m = list(map(int, input().split()))
PAIRS = [(a, 1) for a in map(int, input().split())]
for _ in range(m):
    b, c = list(map(int, input().split()))
    PAIRS.append((c, b))
PAIRS.sort(reverse=True)
answer, count = 0, 0
for pair in PAIRS:
    answer += pair[0] * pair[1]
    count += pair[1]
    if count > n:
        answer -= pair[0] * (count - n)
        break
print(answer)

-PAIRS = [[-a, -1] for a in map(int, input().split())]

+PAIRS = [(a, 1) for a in map(int, input().split())]

+        answer -= pair[0] * (count - n)


Input:
# 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:

import numpy as np

import sys

w = eval(input())

countn = np.zeros(26)

ew = "abcdefghijklmnopqrstuvwxyz"

i = 0

while i < 26:

    countn[i] = w.count(ew[i])

    if countn[i] %2 != 0:

        print("No")

        sys.exit()

    i +=1

print("Yes")

# optimized version of the same code:

#ABC044B

w = eval(input())

l = len(w)

sig = 0

for i in range(l):

    if w.count(w[i])%2 !=0:

        sig = 1

        break

if sig == 1:

    print("No")

else:

    print("Yes")

import numpy as np
import sys

w = eval(input())
countn = np.zeros(26)
ew = "abcdefghijklmnopqrstuvwxyz"
i = 0
while i < 26:
    countn[i] = w.count(ew[i])
    if countn[i] % 2 != 0:
        print("No")
        sys.exit()
    i += 1
print("Yes")

# ABC044B
w = eval(input())
l = len(w)
sig = 0
for i in range(l):
    if w.count(w[i]) % 2 != 0:
        sig = 1
        break
if sig == 1:
    print("No")
else:
    print("Yes")

-import numpy as np
-import sys
+# ABC044B
-countn = np.zeros(26)
-ew = "abcdefghijklmnopqrstuvwxyz"
-i = 0
-while i < 26:
-    countn[i] = w.count(ew[i])
-    if countn[i] % 2 != 0:
-        print("No")
-        sys.exit()
-    i += 1
-print("Yes")
+l = len(w)
+sig = 0
+for i in range(l):
+    if w.count(w[i]) % 2 != 0:
+        sig = 1
+        break
+if sig == 1:
+    print("No")
+else:
+    print("Yes")


Input:
# 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:

import math

n = int(eval(input()))

ans = math.factorial(n) % (pow(10, 9) + 7)

print(ans)

# optimized version of the same code:

n = int(eval(input()))

ans = 1

mod = 10 ** 9 + 7

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

    ans = (ans * i % mod) % mod

print(ans)

n = int(eval(input()))
ans = 1
mod = 10**9 + 7
for i in range(1, n + 1):
    ans = (ans * i % mod) % mod
print(ans)

-ans = math.factorial(n) % (pow(10, 9) + 7)


Input:
# 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:

k = int(eval(input()))

x = 1

if k%7 != 0:

    mod = 9*k

else:

    mod = 9*k//7

for i in range(10**6):

    x = x*10%mod

    if x == 1:

        print((i + 1))

        exit()

print((-1))

# optimized version of the same code:

k = int(eval(input()))

a = 0

for i in range(k + 10):

    a = (a*10 + 7)%k

    if a == 0:

        print((i + 1))

        exit()

print((-1))

k = int(eval(input()))
x = 1
if k % 7 != 0:
    mod = 9 * k
else:
    mod = 9 * k // 7
for i in range(10**6):
    x = x * 10 % mod
    if x == 1:
        print((i + 1))
        exit()
print((-1))

k = int(eval(input()))
a = 0
for i in range(k + 10):
    a = (a * 10 + 7) % k
    if a == 0:
        print((i + 1))
        exit()
print((-1))


Input:
# 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:

s = eval(input())

cnt = 0

ans = 0

for c in s:

    if c == 'B':

        cnt += 1

    elif c == 'W':

        ans += cnt

print(ans)

# optimized version of the same code:

s = eval(input())

ans = 0

b = 0

for ss in s:

    if ss == 'W':

        ans += b

    else:

        b += 1

print(ans)

s = eval(input())
cnt = 0
ans = 0
for c in s:
    if c == "B":
        cnt += 1
    elif c == "W":
        ans += cnt
print(ans)

s = eval(input())
ans = 0
b = 0
for ss in s:
    if ss == "W":
        ans += b
    else:
        b += 1
print(ans)

-cnt = 0
-for c in s:
-    if c == "B":
-        cnt += 1
-    elif c == "W":
-        ans += cnt
+b = 0
+for ss in s:
+    if ss == "W":
+        ans += b
+    else:
+        b += 1


Input:
# 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:

import math

def pri(n):

    if n < 2:

        return False

    elif n == 2:

        return True

    elif n % 2 == 0:

        return False

    i = 3

    while i <= math.sqrt(n):

        if n % i == 0:

            return False

        i += 2

    return True

l=[i for i in range(110000)if pri(i) ]

while True:

    n = int(eval(input()))

    if n == 0: break

    print((sum(l[:n])))

# optimized version of the same code:

import math

def pri(n):

    l =[True] * n

    l[0] = l[1] = False

    for i in range(2,n):

        if l[i]:

            for j in range(i*2, n, i):

                l[j] = False

    return l

n=105000

s=pri(n)

l=[i for i in range(n) if s[i]]

while True:

    n = int(eval(input()))

    if n == 0: break

    print((sum(l[:n])))

import math

def pri(n):
    if n < 2:
        return False
    elif n == 2:
        return True
    elif n % 2 == 0:
        return False
    i = 3
    while i <= math.sqrt(n):
        if n % i == 0:
            return False
        i += 2
    return True

l = [i for i in range(110000) if pri(i)]
while True:
    n = int(eval(input()))
    if n == 0:
        break
    print((sum(l[:n])))

import math

def pri(n):
    l = [True] * n
    l[0] = l[1] = False
    for i in range(2, n):
        if l[i]:
            for j in range(i * 2, n, i):
                l[j] = False
    return l

n = 105000
s = pri(n)
l = [i for i in range(n) if s[i]]
while True:
    n = int(eval(input()))
    if n == 0:
        break
    print((sum(l[:n])))

+            for j in range(i * 2, n, i):

-l = [i for i in range(110000) if pri(i)]


Input:
# 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()))

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

print((sum(l[i]<l[i+1]<l[i+2] or l[i]>l[i+1]>l[i+2] for i in range(n-2))))

# optimized version of the same code:

n=int(eval(input()))

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

a=0

for i in range(n-2):

  p,q,r=l[i:i+3]

  if p<q<r or r<q<p: a+=1

print(a)

n = int(eval(input()))
l = list(map(int, input().split()))
print(
    (
        sum(
            l[i] < l[i + 1] < l[i + 2] or l[i] > l[i + 1] > l[i + 2]
            for i in range(n - 2)
        )
    )
)

n = int(eval(input()))
l = list(map(int, input().split()))
a = 0
for i in range(n - 2):
    p, q, r = l[i : i + 3]
    if p < q < r or r < q < p:
        a += 1
print(a)


Input:
# 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:

from numpy import*

a,b=median(t:=loadtxt(open(0),skiprows=1),0)

print((int((a-b)*~(~len(t)%2))+1))

# optimized version of the same code:

from statistics import*

(n,),*t=[list(map(int,t.split()))for t in open(0)]

a,b=list(map(median,list(zip(*t))))

print((int((b-a)*(2-n%2))+1))

from numpy import *

a, b = median(t := loadtxt(open(0), skiprows=1), 0)
print((int((a - b) * ~(~len(t) % 2)) + 1))

from statistics import *

(n,), *t = [list(map(int, t.split())) for t in open(0)]
a, b = list(map(median, list(zip(*t))))
print((int((b - a) * (2 - n % 2)) + 1))

-a, b = median(t := loadtxt(open(0), skiprows=1), 0)

+(n,), *t = [list(map(int, t.split())) for t in open(0)]

+a, b = list(map(median, list(zip(*t))))


Input:
# 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:

import sys

input = sys.stdin.readline

sys.setrecursionlimit(10 ** 7)

"""

奇数番目集合、偶数番目集合の中で自由にできるのが操作2．

操作1で集合間のやりとりをする

"""

import numpy as np

N = int(eval(input()))

A = np.fromstring(sys.stdin.read(),dtype=np.int64,sep='\n')

B = np.sort(A)

answer = len(np.setdiff1d(A[::2],B[::2]))

print(answer)

# optimized version of the same code:

import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

"""

・偶数番号、奇数番号の中では入れ替え放題

・偶、奇の間：並べてからスワップ。操作2を1回で、正しいものを2つ増やせる

"""

N,*A = list(map(int,read().split()))

x_to_i = {x:i for i,x in enumerate(sorted(A))}

rank = [x_to_i[x] for x in A]

answer = sum((x^i) & 1 for i,x in enumerate(rank)) // 2

print(answer)

import sys

input = sys.stdin.readline
sys.setrecursionlimit(10**7)
"""
奇数番目集合、偶数番目集合の中で自由にできるのが操作2．
操作1で集合間のやりとりをする
"""
import numpy as np

N = int(eval(input()))
A = np.fromstring(sys.stdin.read(), dtype=np.int64, sep="\n")
B = np.sort(A)
answer = len(np.setdiff1d(A[::2], B[::2]))
print(answer)

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
"""
・偶数番号、奇数番号の中では入れ替え放題
・偶、奇の間：並べてからスワップ。操作2を1回で、正しいものを2つ増やせる
"""
N, *A = list(map(int, read().split()))
x_to_i = {x: i for i, x in enumerate(sorted(A))}
rank = [x_to_i[x] for x in A]
answer = sum((x ^ i) & 1 for i, x in enumerate(rank)) // 2
print(answer)

-奇数番目集合、偶数番目集合の中で自由にできるのが操作2．

-操作1で集合間のやりとりをする

+・偶数番号、奇数番号の中では入れ替え放題

+・偶、奇の間：並べてからスワップ。操作2を1回で、正しいものを2つ増やせる

-A = np.fromstring(sys.stdin.read(), dtype=np.int64, sep="\n")

-answer = len(np.setdiff1d(A[::2], B[::2]))

+x_to_i = {x: i for i, x in enumerate(sorted(A))}

+answer = sum((x ^ i) & 1 for i, x in enumerate(rank)) // 2


Input:
# 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:

import numpy as np

x = int(eval(input()))

y = input().split()

y = [int(i) for i in y]

y = np.array(y)

count = 0

while sum([y[i] % 2 for i in range(len(y))]) == 0:

    y = y/2

    count += 1

print(count)

# optimized version of the same code:

N = int(eval(input()))

A = input().split()

A = [int(i) for i in A]

c = 0

while True:

  exist_odd = False

  for a in A:

    if a % 2 != 0:

      exist_odd = True

  if exist_odd: break

  for i in range(N):

    A[i] = A[i] / 2

  c = c + 1

print(c)

import numpy as np

x = int(eval(input()))
y = input().split()
y = [int(i) for i in y]
y = np.array(y)
count = 0
while sum([y[i] % 2 for i in range(len(y))]) == 0:
    y = y / 2
    count += 1
print(count)

-while sum([y[i] % 2 for i in range(len(y))]) == 0:


Input:
# 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(input())

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

ans, s = 0, 0

d = {0:1}

for i in A:

    s += i

    ans += d.get(s, 0)

    d[s] = d.get(s, 0) + 1

print(ans)

# optimized version of the same code:

#!/usr/bin/env python3

from collections import defaultdict

N = int(eval(input()))

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

d = defaultdict(int)

d[0] = 1

s, ans = 0, 0

for a in A:

    s += a

    ans += d[s]

    d[s] += 1

print (ans)

N = int(input())
A = list(map(int, input().split()))
ans, s = 0, 0
d = {0: 1}
for i in A:
    s += i
    ans += d.get(s, 0)
    d[s] = d.get(s, 0) + 1
print(ans)

#!/usr/bin/env python3
from collections import defaultdict

N = int(eval(input()))
A = list(map(int, input().split()))
d = defaultdict(int)
d[0] = 1
s, ans = 0, 0
for a in A:
    s += a
    ans += d[s]
    d[s] += 1
print(ans)

-N = int(input())
+#!/usr/bin/env python3
+from collections import defaultdict
+
+N = int(eval(input()))
-ans, s = 0, 0
-d = {0: 1}
-for i in A:
-    s += i
-    ans += d.get(s, 0)
-    d[s] = d.get(s, 0) + 1
+d = defaultdict(int)
+d[0] = 1
+s, ans = 0, 0
+for a in A:
+    s += a
+    ans += d[s]
+    d[s] += 1


Input:
# 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:

import numpy as np

n=int(eval(input()))

ABC=[list(map(int,input().split())) for _ in range(n)]

dp=np.zeros((n,3),int)

for i in range(3):

  dp[0][i]=ABC[0][i]

for i in range(n-1):

  for j in range(3):

    dp[i+1][j]=max(dp[i][(j+1)%3]+ABC[i+1][j], dp[i][(j+2)%3]+ABC[i+1][j])

print((max(dp[-1])))

# optimized version of the same code:

import numpy as np

n=int(eval(input()))

ABC=[list(map(int,input().split())) for _ in range(n)]

dp=np.zeros((n,3),int)

for i in range(3):

  dp[0,i]=ABC[0][i]

for i in range(1,n):

  for j in range(3):

    dp[i,j]=max(dp[i-1,(j+1)%3]+ABC[i][j],dp[i-1,(j+2)%3]+ABC[i][j])

print((max(dp[-1])))

import numpy as np

n = int(eval(input()))
ABC = [list(map(int, input().split())) for _ in range(n)]
dp = np.zeros((n, 3), int)
for i in range(3):
    dp[0][i] = ABC[0][i]
for i in range(n - 1):
    for j in range(3):
        dp[i + 1][j] = max(
            dp[i][(j + 1) % 3] + ABC[i + 1][j], dp[i][(j + 2) % 3] + ABC[i + 1][j]
        )
print((max(dp[-1])))

import numpy as np

n = int(eval(input()))
ABC = [list(map(int, input().split())) for _ in range(n)]
dp = np.zeros((n, 3), int)
for i in range(3):
    dp[0, i] = ABC[0][i]
for i in range(1, n):
    for j in range(3):
        dp[i, j] = max(
            dp[i - 1, (j + 1) % 3] + ABC[i][j], dp[i - 1, (j + 2) % 3] + ABC[i][j]
        )
print((max(dp[-1])))


Input:
# 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()))

l = [list(map(int, input().split())) for _ in range(N)]

dp = [[0 for i in range(3)] for j in range(N+1)]

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

    for j in range(3):

        for k in range(3):

            if j != k:

                dp[i][j] = max(dp[i][j], dp[i-1][k]+l[i-1][k])

print((max(dp[N][0], dp[N][1], dp[N][2])))

# optimized version of the same code:

N = int(eval(input()))

dp = [[0 for i in range(3)] for j in range(N+1)]

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

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

    for j in range(3):

        for k in range(3):

            if j != k:

                dp[i][j] = max(dp[i][j], dp[i-1][k] + hapiness[k])

print((max(dp[N][0], dp[N][1], dp[N][2])))

N = int(eval(input()))
l = [list(map(int, input().split())) for _ in range(N)]
dp = [[0 for i in range(3)] for j in range(N + 1)]
for i in range(1, N + 1):
    for j in range(3):
        for k in range(3):
            if j != k:
                dp[i][j] = max(dp[i][j], dp[i - 1][k] + l[i - 1][k])
print((max(dp[N][0], dp[N][1], dp[N][2])))

N = int(eval(input()))
dp = [[0 for i in range(3)] for j in range(N + 1)]
for i in range(1, N + 1):
    hapiness = list(map(int, input().split()))
    for j in range(3):
        for k in range(3):
            if j != k:
                dp[i][j] = max(dp[i][j], dp[i - 1][k] + hapiness[k])
print((max(dp[N][0], dp[N][1], dp[N][2])))

-l = [list(map(int, input().split())) for _ in range(N)]

+    hapiness = list(map(int, input().split()))

+                dp[i][j] = max(dp[i][j], dp[i - 1][k] + hapiness[k])


Input:
# 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:

import sys

input = sys.stdin.readline

def main():

    ans = 0

    n = int(input())

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

    l = [0]*n

    for i in range(n):

        l[o[i]-1] = i+1

    for i in range(len(l)):

        if  i != len(l)-1:

            print("{} ".format(l[i]), end='')

        else:

            print(l[i])

if __name__ == '__main__':

    main()

# optimized version of the same code:

import sys

input = sys.stdin.readline

def main():

    ans = 0

    n = int(eval(input()))

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

    l = [0]*n

    for i in range(n):

        l[o[i]-1] = i+1

    print((" ".join(map(str,l))))

if __name__ == '__main__':

    main()

import sys

input = sys.stdin.readline

def main():
    ans = 0
    n = int(input())
    o = list(map(int, input().split()))
    l = [0] * n
    for i in range(n):
        l[o[i] - 1] = i + 1
    for i in range(len(l)):
        if i != len(l) - 1:
            print("{} ".format(l[i]), end="")
        else:
            print(l[i])

if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline

def main():
    ans = 0
    n = int(eval(input()))
    o = list(map(int, input().split()))
    l = [0] * n
    for i in range(n):
        l[o[i] - 1] = i + 1
    print((" ".join(map(str, l))))

if __name__ == "__main__":
    main()

-            print("{} ".format(l[i]), end="")


Input:
# 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,L = list(map(int, input().split()))

taste = [L+i-1 for i in range(1,N+1)]

if taste[-1] < 0:

  print((sum(taste) + min([abs(x) for x in taste])))

else:

  print((sum(taste) - min([abs(x) for x in taste])))

# optimized version of the same code:

N, L = list(map(int, input().split()))

taste = [L+i-1 for i in range(1, N+1)]

if 0 in taste:

    select = 0

else:

    select_with_ind = min(enumerate(taste), key = lambda x: abs(x[1]))

    select = select_with_ind[1]

print((sum(taste) - select))

N, L = list(map(int, input().split()))
taste = [L + i - 1 for i in range(1, N + 1)]
if taste[-1] < 0:
    print((sum(taste) + min([abs(x) for x in taste])))
else:
    print((sum(taste) - min([abs(x) for x in taste])))

N, L = list(map(int, input().split()))
taste = [L + i - 1 for i in range(1, N + 1)]
if 0 in taste:
    select = 0
else:
    select_with_ind = min(enumerate(taste), key=lambda x: abs(x[1]))
    select = select_with_ind[1]
print((sum(taste) - select))

-    print((sum(taste) + min([abs(x) for x in taste])))

-    print((sum(taste) - min([abs(x) for x in taste])))

+    select_with_ind = min(enumerate(taste), key=lambda x: abs(x[1]))


Input:
# 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:

# ABC090B - Palindromic Numbers

a, b = list(map(int, input().rstrip().split()))

count = 0

for i in range(a, b + 1):

    lst = list(map(int, list(str(i))))

    if lst[0] == lst[4] and lst[1] == lst[3]:

        count += 1

print(count)

# optimized version of the same code:

# ABC090B - Palindromic Numbers

def main():

    a, b = list(map(int, input().rstrip().split()))

    cnt = 0

    for i in range(a, b + 1):

        s = str(i)

        if s == s[::-1]:

            cnt += 1

    print(cnt)

if __name__ == "__main__":

    main()

-a, b = list(map(int, input().rstrip().split()))

+    a, b = list(map(int, input().rstrip().split()))


Input:
# 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, m = list(map(int, input().split()))

dp = [0] * n

for i in range(m):

    x, y = list(map(int, input().split()))

    dp[x - 1] += 1

    dp[y - 1] += 1

for i in range(n):

    print((dp[i]))

# optimized version of the same code:

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

A = [0] * n

for i in range(m):

    a, b = list(map(int, input().split()))

    A[a - 1] += 1

    A[b - 1] += 1

for i in range(n):

    print((A[i]))

-    x, y = list(map(int, input().split()))

+    a, b = list(map(int, input().split()))


Input:
# 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:

import sys

sys.setrecursionlimit(2147483647)

INF=float("inf")

MOD=10**9+7

input=lambda :sys.stdin.readline().rstrip()

from collections import deque

def resolve():

    k=int(eval(input()))

    E=[[] for _ in range(k)]

    for i in range(k):

        E[i].append(((i+1)%k,1))

        E[i].append(((10*i)%k,0))

    # 0-1 BFS

    dist=[INF]*k

    dist[1]=0

    Q=deque([1])

    while(Q):

        v=Q.popleft()

        for nv,w in E[v]:

            if(dist[nv]<=dist[v]+w): continue

            dist[nv]=dist[v]+w

            if(w==0): Q.appendleft(nv)

            else: Q.append(nv)

    print((dist[0]+1))

resolve()

# optimized version of the same code:

import sys

INF = 1 << 60

MOD = 10**9 + 7 # 998244353

sys.setrecursionlimit(2147483647)

input = lambda:sys.stdin.readline().rstrip()

from collections import deque

def resolve():

    k = int(eval(input()))

    dist = [INF] * k

    dist[1] = 1

    queue = deque([1])

    while queue:

        v = queue.pop()

        if dist[10 * v % k] > dist[v]:

            dist[10 * v % k] = dist[v]

            queue.appendleft(10 * v % k)

        if dist[(v + 1) % k] > dist[v] + 1:

            dist[(v + 1) % k] = dist[v] + 1

            queue.append((v + 1) % k)

    print((dist[0]))

resolve()

import sys

sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 10**9 + 7
input = lambda: sys.stdin.readline().rstrip()
from collections import deque

def resolve():
    k = int(eval(input()))
    E = [[] for _ in range(k)]
    for i in range(k):
        E[i].append(((i + 1) % k, 1))
        E[i].append(((10 * i) % k, 0))
    # 0-1 BFS
    dist = [INF] * k
    dist[1] = 0
    Q = deque([1])
    while Q:
        v = Q.popleft()
        for nv, w in E[v]:
            if dist[nv] <= dist[v] + w:
                continue
            dist[nv] = dist[v] + w
            if w == 0:
                Q.appendleft(nv)
            else:
                Q.append(nv)
    print((dist[0] + 1))

resolve()

import sys

INF = 1 << 60
MOD = 10**9 + 7  # 998244353
sys.setrecursionlimit(2147483647)
input = lambda: sys.stdin.readline().rstrip()
from collections import deque

def resolve():
    k = int(eval(input()))
    dist = [INF] * k
    dist[1] = 1
    queue = deque([1])
    while queue:
        v = queue.pop()
        if dist[10 * v % k] > dist[v]:
            dist[10 * v % k] = dist[v]
            queue.appendleft(10 * v % k)
        if dist[(v + 1) % k] > dist[v] + 1:
            dist[(v + 1) % k] = dist[v] + 1
            queue.append((v + 1) % k)
    print((dist[0]))

resolve()

-            if dist[nv] <= dist[v] + w:

+            queue.appendleft(10 * v % k)


Input:
# 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:

import math

n = int(eval(input()))

print((math.factorial(n) % (10**9 + 7)))

# optimized version of the same code:

n = int(eval(input()))

ans = 1

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

    ans *= i

    ans %= 10**9 + 7

print(ans)

n = int(eval(input()))
ans = 1
for i in range(1, n + 1):
    ans *= i
    ans %= 10**9 + 7
print(ans)

-print((math.factorial(n) % (10**9 + 7)))


Input:
# 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,K = list(map(int,input().split()))

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

cums = [0]

cump = [0]

for a in src:

    cums.append(cums[-1] + a)

    cump.append(cump[-1] + max(0,a))

ans = 0

for i in range(N-K+1):

    tmp = cump[i]

    tmp += max(0, cums[i+K] - cums[i])

    tmp += cump[N] - cump[i+K]

    ans = max(tmp, ans)

print(ans)

# optimized version of the same code:

N,K = list(map(int,input().split()))

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

cums = [0]

cums_p = [0]

for a in A:

    cums.append(cums[-1] + a)

    cums_p.append(cums_p[-1] + max(0,a))

ans = -float('inf')

for l in range(N-K+1):

    free = cums_p[l] + cums_p[-1] - cums_p[l+K]

    cont = cums[l+K] - cums[l]

    ans = max(ans, free, free+cont)

print(ans)

N, K = list(map(int, input().split()))
src = list(map(int, input().split()))
cums = [0]
cump = [0]
for a in src:
    cums.append(cums[-1] + a)
    cump.append(cump[-1] + max(0, a))
ans = 0
for i in range(N - K + 1):
    tmp = cump[i]
    tmp += max(0, cums[i + K] - cums[i])
    tmp += cump[N] - cump[i + K]
    ans = max(tmp, ans)
print(ans)

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
cums = [0]
cums_p = [0]
for a in A:
    cums.append(cums[-1] + a)
    cums_p.append(cums_p[-1] + max(0, a))
ans = -float("inf")
for l in range(N - K + 1):
    free = cums_p[l] + cums_p[-1] - cums_p[l + K]
    cont = cums[l + K] - cums[l]
    ans = max(ans, free, free + cont)
print(ans)

-    tmp += max(0, cums[i + K] - cums[i])

+    cums_p.append(cums_p[-1] + max(0, a))

+    free = cums_p[l] + cums_p[-1] - cums_p[l + K]


Input:
# 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:

def factorial(N):

    power_r = 1

    for n in range(2,N+1):

        power_r *= n

        power_r %= 10**9+7

    return power_r

if __name__ == '__main__':

    N = int(eval(input()))

    print((factorial(N)))

# optimized version of the same code:

def factorial(N):

    power_r = 1

    for n in range(2,N+1):

        power_r = power_r*n % (10**9+7)

    return power_r

if __name__ == '__main__':

    N = int(eval(input()))

    print((factorial(N)))

def factorial(N):
    power_r = 1
    for n in range(2, N + 1):
        power_r *= n
        power_r %= 10**9 + 7
    return power_r

if __name__ == "__main__":
    N = int(eval(input()))
    print((factorial(N)))

def factorial(N):
    power_r = 1
    for n in range(2, N + 1):
        power_r = power_r * n % (10**9 + 7)
    return power_r

if __name__ == "__main__":
    N = int(eval(input()))
    print((factorial(N)))


Input:
# 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:

import sys

K = int(eval(input()))

power = 7

SUM = 0

for i in range(1, 10 ** 6):

    SUM += power

    if SUM % K == 0:

        print(i)

        sys.exit()

    power *= 10

    power %= K

print((-1))

# optimized version of the same code:

import sys

K = int(eval(input()))

L = 9 * K

if K % 7 == 0:

    L //= 7

power = 1

for i in range(1, 10 ** 6):

    power *= 10

    power %= L

    if power == 1:

        print(i)

        sys.exit()

print((-1))

import sys

K = int(eval(input()))
power = 7
SUM = 0
for i in range(1, 10**6):
    SUM += power
    if SUM % K == 0:
        print(i)
        sys.exit()
    power *= 10
    power %= K
print((-1))

import sys

K = int(eval(input()))
L = 9 * K
if K % 7 == 0:
    L //= 7
power = 1
for i in range(1, 10**6):
    power *= 10
    power %= L
    if power == 1:
        print(i)
        sys.exit()
print((-1))

-power = 7
-SUM = 0
+L = 9 * K
+if K % 7 == 0:
+    L //= 7
+power = 1
-    SUM += power
-    if SUM % K == 0:
+    power *= 10
+    power %= L
+    if power == 1:
-    power *= 10
-    power %= K


Input:
# 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:

import numpy as np

import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

N, K = list(map(int, readline().split()))

A = np.array(readline().split(), dtype=np.int64) + 1

Acum = np.zeros(N+1, np.float64)

Acum[1:] = A.cumsum()

x = Acum[K:] - Acum[:-K]

print((x.max()/2))

# optimized version of the same code:

import sys

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read

input = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

from itertools import accumulate

N, K = list(map(int, input().split()))

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

Pcum = list(accumulate([0] + [(1+p)/2 for p in P]))

ans = max(right - left for left, right in zip(Pcum, Pcum[K:]))

print(ans)

import numpy as np
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, K = list(map(int, readline().split()))
A = np.array(readline().split(), dtype=np.int64) + 1
Acum = np.zeros(N + 1, np.float64)
Acum[1:] = A.cumsum()
x = Acum[K:] - Acum[:-K]
print((x.max() / 2))

import sys

sys.setrecursionlimit(10**7)
read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from itertools import accumulate

N, K = list(map(int, input().split()))
P = list(map(int, input().split()))
Pcum = list(accumulate([0] + [(1 + p) / 2 for p in P]))
ans = max(right - left for left, right in zip(Pcum, Pcum[K:]))
print(ans)

-N, K = list(map(int, readline().split()))

-A = np.array(readline().split(), dtype=np.int64) + 1

+Pcum = list(accumulate([0] + [(1 + p) / 2 for p in P]))

+ans = max(right - left for left, right in zip(Pcum, Pcum[K:]))


Input:
# 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:

import numpy as np

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

x=[list(map(int,input().split())) for i in range(n)]

count=0

for i in range(n-1):

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

        a=np.array(x[i])

        b=np.array(x[j])

        ab=sum(np.power((a-b),2))**0.5

        if ab%1==0:

            count+=1

print(count)

# optimized version of the same code:

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

L=[list(map(int,input().split())) for i in range(n)]

ans=0

for i in range(n-1):

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

        a=0

        for k in range(d):

            a+=(L[i][k]-L[j][k])**2

        if int(a**0.5)==a**0.5:

            ans+=1

print(ans)

import numpy as np

n, d = list(map(int, input().split()))
x = [list(map(int, input().split())) for i in range(n)]
count = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        a = np.array(x[i])
        b = np.array(x[j])
        ab = sum(np.power((a - b), 2)) ** 0.5
        if ab % 1 == 0:
            count += 1
print(count)

n, d = list(map(int, input().split()))
L = [list(map(int, input().split())) for i in range(n)]
ans = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        a = 0
        for k in range(d):
            a += (L[i][k] - L[j][k]) ** 2
        if int(a**0.5) == a**0.5:
            ans += 1
print(ans)

-x = [list(map(int, input().split())) for i in range(n)]

+L = [list(map(int, input().split())) for i in range(n)]


Input:
# 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:

for n in range(eval(input())):

  a,b,c=sorted(map(int,input().split()))

  s="YES" if a*a+b*b==c*c else "NO"

  print(s)

# optimized version of the same code:

for n in range(eval(input())):

  a,b,c=sorted(map(int,input().split()))

  print("YES" if a*a + b*b == c*c else "NO")

for n in range(eval(input())):
    a, b, c = sorted(map(int, input().split()))
    s = "YES" if a * a + b * b == c * c else "NO"
    print(s)

for n in range(eval(input())):
    a, b, c = sorted(map(int, input().split()))
    print("YES" if a * a + b * b == c * c else "NO")

-    s = "YES" if a * a + b * b == c * c else "NO"

+    print("YES" if a * a + b * b == c * c else "NO")


Input:
# 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:

x=int(eval(input()))

for i in range(-118,120):

  for j in range(-119,129):

    if i**5-j**5==x:

      print((i,j))

      exit()

# optimized version of the same code:

x = int(eval(input()))

for i in range(120):

  for j in range(-119,129):

    if i**5 - j**5 == x:

      print((i, j))

      exit()

x = int(eval(input()))
for i in range(-118, 120):
    for j in range(-119, 129):
        if i**5 - j**5 == x:
            print((i, j))
            exit()

x = int(eval(input()))
for i in range(120):
    for j in range(-119, 129):
        if i**5 - j**5 == x:
            print((i, j))
            exit()

-for i in range(-118, 120):
+for i in range(120):


Input:
# 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:

#E

from itertools import accumulate

from bisect import bisect_left

def main():

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

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

    A.sort()

    def count(k):

        cnt=0

        for a in A:

            cnt+=bisect_left(A,k-a)

        return cnt

    ok=0

    ng=10**10+1

    while ng-ok>1:

        mid=(ok+ng)//2

        if count(mid)<n**2-m:

            ok=mid

        else:

            ng=mid

    border=ok

    k=n**2-count(border)

    Acc=[0]+list(accumulate(A))

    s=Acc[-1]

    ans=0

    for a in A:

        idx=bisect_left(A,border-a)

        ans+=a*(n-idx)+(s-Acc[idx])

    ans-=border*(k-m)

    print(ans)

if __name__=='__main__':

    main()

# optimized version of the same code:

from itertools import accumulate

from bisect import bisect_left

def main():

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

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

    A.sort()

    def count(k):

        cnt=0

        for a in A:

            cnt+=bisect_left(A,k-a)

        return cnt

    ok=0

    ng=2*10**5+1

    while ng-ok>1:

        mid=(ok+ng)//2

        if count(mid)<n**2-m:

            ok=mid

        else:

            ng=mid

    border=ok

    k=n**2-count(border)

    Acc=[0]+list(accumulate(A))

    s=Acc[-1]

    ans=0

    for a in A:

        idx=bisect_left(A,border-a)

        ans+=a*(n-idx)+(s-Acc[idx])

    ans-=border*(k-m)

    print(ans)

if __name__=='__main__':

    main()

# E
from itertools import accumulate
from bisect import bisect_left

def main():
    n, m = list(map(int, input().split()))
    A = list(map(int, input().split()))
    A.sort()

    def count(k):
        cnt = 0
        for a in A:
            cnt += bisect_left(A, k - a)
        return cnt

    ok = 0
    ng = 10**10 + 1
    while ng - ok > 1:
        mid = (ok + ng) // 2
        if count(mid) < n**2 - m:
            ok = mid
        else:
            ng = mid
    border = ok
    k = n**2 - count(border)
    Acc = [0] + list(accumulate(A))
    s = Acc[-1]
    ans = 0
    for a in A:
        idx = bisect_left(A, border - a)
        ans += a * (n - idx) + (s - Acc[idx])
    ans -= border * (k - m)
    print(ans)

if __name__ == "__main__":
    main()

from itertools import accumulate
from bisect import bisect_left

def main():
    n, m = list(map(int, input().split()))
    A = list(map(int, input().split()))
    A.sort()

    def count(k):
        cnt = 0
        for a in A:
            cnt += bisect_left(A, k - a)
        return cnt

    ok = 0
    ng = 2 * 10**5 + 1
    while ng - ok > 1:
        mid = (ok + ng) // 2
        if count(mid) < n**2 - m:
            ok = mid
        else:
            ng = mid
    border = ok
    k = n**2 - count(border)
    Acc = [0] + list(accumulate(A))
    s = Acc[-1]
    ans = 0
    for a in A:
        idx = bisect_left(A, border - a)
        ans += a * (n - idx) + (s - Acc[idx])
    ans -= border * (k - m)
    print(ans)

if __name__ == "__main__":
    main()


Input:
# 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:

import sys

input = sys.stdin.readline

n = int(eval(input()))

v = [[0]+[]*(n+1) for i in range(n+1)]

for i in range(n-1):

    a,b,c = list(map(int,input().split()))

    v[a].append([b,c])

    v[b].append([a,c])

q,k = list(map(int,input().split()))

l = [k]

while l:

    now = l.pop()

    for i in v[now][1:]:

        if v[i[0]][0] == 0:

            v[i[0]][0] = i[1]+v[now][0]

            l.append(i[0])

for i in range(q):

    x,y = list(map(int,input().split()))

    print((v[x][0]+v[y][0]))

# optimized version of the same code:

import sys

def main():

    input = sys.stdin.readline

    n = int(eval(input()))

    v = [[0]+[]*(n+1) for i in range(n+1)]

    for i in range(n-1):

        a,b,c = list(map(int,input().split()))

        v[a].append([b,c])

        v[b].append([a,c])

    q,k = list(map(int,input().split()))

    l = [k]

    while l:

        now = l.pop()

        for i in v[now][1:]:

            if v[i[0]][0] == 0:

                v[i[0]][0] = i[1]+v[now][0]

                l.append(i[0])

    for i in range(q):

        x,y = list(map(int,input().split()))

        print((v[x][0]+v[y][0]))

if __name__ == '__main__':

    main()

import sys

input = sys.stdin.readline
n = int(eval(input()))
v = [[0] + [] * (n + 1) for i in range(n + 1)]
for i in range(n - 1):
    a, b, c = list(map(int, input().split()))
    v[a].append([b, c])
    v[b].append([a, c])
q, k = list(map(int, input().split()))
l = [k]
while l:
    now = l.pop()
    for i in v[now][1:]:
        if v[i[0]][0] == 0:
            v[i[0]][0] = i[1] + v[now][0]
            l.append(i[0])
for i in range(q):
    x, y = list(map(int, input().split()))
    print((v[x][0] + v[y][0]))

import sys

def main():
    input = sys.stdin.readline
    n = int(eval(input()))
    v = [[0] + [] * (n + 1) for i in range(n + 1)]
    for i in range(n - 1):
        a, b, c = list(map(int, input().split()))
        v[a].append([b, c])
        v[b].append([a, c])
    q, k = list(map(int, input().split()))
    l = [k]
    while l:
        now = l.pop()
        for i in v[now][1:]:
            if v[i[0]][0] == 0:
                v[i[0]][0] = i[1] + v[now][0]
                l.append(i[0])
    for i in range(q):
        x, y = list(map(int, input().split()))
        print((v[x][0] + v[y][0]))

if __name__ == "__main__":
    main()

-    a, b, c = list(map(int, input().split()))

-    x, y = list(map(int, input().split()))

+        a, b, c = list(map(int, input().split()))

+    q, k = list(map(int, input().split()))

+        x, y = list(map(int, input().split()))


Input:
# 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:

import numpy as np

N = int(eval(input()))

X = np.array(list(map(int, input().split())))

cost = float("inf")

for i in range(max(X) - min(X) + 1):

    p = min(X) + i

    cost = min(np.sum((X - p) ** 2), cost)

print(cost)

# optimized version of the same code:

N = int(eval(input()))

X = sorted(list(map(int, input().split())))

if N == 1:

    print((0))

else:

    r = X[-1] - X[0]

    ans = float("inf")

    for i in range(r + 1):

        R = X[0] + i

        hp = 0

        for j in range(N):

            hp = hp + (R - X[j]) ** 2

        ans = min(hp, ans)

    print(ans)

-X = np.array(list(map(int, input().split())))

-    cost = min(np.sum((X - p) ** 2), cost)

+X = sorted(list(map(int, input().split())))


Input:
# 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:

from functools import reduce

from itertools import product

N = int(eval(input()))

*A, = list(map(int, input().split()))

ans = 0

for t in product([-1, 0, 1], repeat=N):

    prod = reduce(lambda x, y: x*y, [a + t[i] for i, a in enumerate(A)])

    if prod % 2 == 0: ans += 1

print(ans)

# optimized version of the same code:

N = int(eval(input()))

*A, = list(map(int, input().split()))

evens = 0

for a in A:

    if a % 2 == 0: evens += 1

ans = 3**N - 2**evens

print(ans)

from functools import reduce
from itertools import product

N = int(eval(input()))
(*A,) = list(map(int, input().split()))
ans = 0
for t in product([-1, 0, 1], repeat=N):
    prod = reduce(lambda x, y: x * y, [a + t[i] for i, a in enumerate(A)])
    if prod % 2 == 0:
        ans += 1
print(ans)

N = int(eval(input()))
(*A,) = list(map(int, input().split()))
evens = 0
for a in A:
    if a % 2 == 0:
        evens += 1
ans = 3**N - 2**evens
print(ans)

-for t in product([-1, 0, 1], repeat=N):

-    prod = reduce(lambda x, y: x * y, [a + t[i] for i, a in enumerate(A)])