Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())
# N:スイッチの数、M：電球の数
s = [[] for _ in range(N)]
for i in range(M):
    temp = list(map(int, input().split()))
    s[i] = temp[1:]
p = list(map(int, input().split()))
ans = 0

# bit全探索
for i in range(2 ** N):
    on = [0 for _ in range(N)]
    for j in range(N): 
        if (i >> j) & 1:
            for k in range(N):
                if j+1 in s[k]:
                    on[k] += 1
    tf = []
    for on_n, p_n in zip(on, p):
        if on_n % 2 == p_n:
            tf.append(True)
        else:
            tf.append(False)
    if all(flg for flg in tf):
        ans += 1

print(ans)


### FIXED CODE ###

# ABC128 C-Switches

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

k = []
s = []
for _ in range(m):
    ks = list(map(int, input().split()))
    k.append(ks[0])
    s.append(ks[1:])
p = list(map(int, input().split()))

ans = 0
for bits in range(2**n):
    flag = True
    for i in range(m):
        on_sum = 0
        for switch in s[i]:
            on_sum += ((bits >> (switch - 1)) & 1)
        flag = flag and ((on_sum % 2) == p[i])
    if flag:
        ans += 1
print(ans)
a = int(input())
b = int(input())
c = int(input())

if (a < b < c):
print("Yes")
else:
print("No")

### FIXED CODE ###

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

if a < b < c:
    print("Yes")
else:
    print("No")
a,b,k=map(int,input().split())
x=a-k
if x<0:
a=0
x=k-a
b=b-k
if b<0:
b=0
print(a,b)


### FIXED CODE ###

a,b,k=map(int,input().split())
if a>k:
    print(a-k,b)
elif a+b>k:
    print(0,b-k+a)
else:    
    print(0,0)
N,K=map(int,input().split())
A=list(map(int,input().split()))
A=[a-1 for a in A]
Arrived=[-1 for i in range(N)]
Appeared=[]
k=0
location=0
T=0
T_List=[]
while k<=K:
    k+=1
    Arrived[location]=k-1
    Appeared.append(location)
    location=A[location]
    if Arrived[location]!=-1:
        T=k-Arrived[location]
        T_List=Appeared[k-T:k]
        break
if len(T_List)==0:
    print(Arrived.index(k-1)+1)
else:
    Destination=(K-(k-T-1))%T
    print(T_List[Destination-1]+1)


### FIXED CODE ###

N,K=map(int,input().split())
A=list(map(int,input().split()))
A=[a-1 for a in A]
Arrived=[-1 for i in range(N)]
Appeared=[]
k=0
location=0
T=0
T_List=[]
while k<=K:
    k+=1
    Arrived[location]=k-1
    Appeared.append(location)
    location=A[location]
    if Arrived[location]!=-1:
        T=k-Arrived[location]
        T_List=Appeared[k-T:k]
        break
if len(T_List)==0:
    print(Arrived.index(k-1)+1)
else:
    Destination=(K-(k-T-1))%T
    print(T_List[Destination-1]+1)
n = int(input())
a = list(map(int,input().split()))
if n == 2:
    print(abs(a[0]-a[1]))
else:
    A = sum(a[:n:])-a[n-1]
	c = 10*9
	c = min(c,A)
    for i in range(1,n-1):
      A=abs(A-2*a[n-i])
      c = min(c,A)
    print(c)


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
A = sum(a[:n-1])-a[n-1]
c = n*(10**9)
c = min(c,abs(A))
if n == 2:
    print(abs(a[0]-a[1]))
else:
    for i in range(1,n-2):
        A=A-2*a[n-1-i]
        c = min(c,abs(A))
    print(c)
import numpy as np
from numpy import array


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

a = array(a)

c_min = 1e5 * n
flag = False

for i in range(1, n ** 2 + 1):
    j = str(bin(i))

    b = np.zeros(m+1)

    for k in range(n):
        if j[k] == 1:
            b += a[k]
    
    if np.all(b[1:] >= m):
        c_min = min(c_min, b[0])
        flag = True

if flag == False:
    c_min = -1

print(c_min)



### FIXED CODE ###

import numpy as np
from numpy import array


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

a = array(a)

c_min = 0
flag = False

for i in range(1, 2 ** n ):
    b = np.zeros(m+1)

    for k in range(n):
        if ((i >> k) & 1):
            b += a[k]
    
    if np.all(b[1:] >= x):
        if flag == False:
            c_min = b[0]
            flag = True
        else:
            c_min = min(c_min, b[0])
        

c_min = int(c_min)

if flag == False:
    c_min = -1

print(c_min)
s1 s2 s3=input().split()
print(s1[0].upper()+s2[0].upper()+s3[0].upper())



### FIXED CODE ###

s1,s2, s3=input().split()
print(s1[0].upper()+s2[0].upper()+s3[0].upper())
n = input()
c1 = c2 = 0
l = len(n)
c1 = l - len([i for i in l[0::2] if i == "0"]) - len([i for i in l[1::2] if i == "1"])
c2 = l - len([i for i in l[0::2] if i == "1"]) - len([i for i in l[1::2] if i == "0"])

print(min(c1,c2))

### FIXED CODE ###

S = input()
c1 = c2 = 0
 
N = len(S)
c1 = N - len([s for s in S[0::2] if s == "0"]) - len([s for s in S[1::2] if s == "1"])
c2 = N - len([s for s in S[0::2] if s == "1"]) - len([s for s in S[1::2] if s == "0"])
 
print(min(c1, c2))
import sys

sys.setrecursionlimit(100000)


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

array = [[int(x) for x in input().split()] for x in range(m)]

adjacency_list = [[] for x in range(m + 1)]

for i in array:
    adjacency_list[i[0]].append(i[1])
    adjacency_list[i[1]].append(i[0])

searched = [False for x in range(m+1)]


def calc(start, maze, searched):
    res = 0
    if searched[start]:
        return 0
    searched[start] = True

    if searched.count(True) == n:
        return 1
    else:
        for next in maze[start]:
            res += calc(next, maze, list(searched))
    return res


print(calc(1, adjacency_list, searched))


### FIXED CODE ###

import sys

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

array = [[int(x) for x in input().split()] for x in range(m)]

if m == 0:
    print(0)
    sys.exit()

adj_array = [[] for x in range(n + 1)]
res_array = [True] + [False for x in range(n)]
for item in array:
    adj_array[item[0]].append(item[1])
    adj_array[item[1]].append(item[0])


def dfs(n, res_array, res):
    res_array[n] = True
    if False not in res_array:
        return res+1
    else:
        for next in adj_array[n]:
            if not res_array[next]:
                res = dfs(next, list(res_array), res)
    return res


res = 0
res_array[1] = True
print(dfs(1, res_array, res))
N = int(input())
A = list(map(int,input().split()))
ans = [0]*N
for i in range(N):
    ans[A[i]-1] += 1
for i in range(N):
    print(ans[i])

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = [0]*N
for i in range(N-1):
    ans[A[i]-1] += 1
for i in range(N):
    print(ans[i])
n = int(input())
s = input()
for i in xrange(n):
  print(s[:i])
  print(s[i+1:])
  a = set(s[:i])
  b = set(s[i+1:])
  num = []
  num.append(len(a.intersection(b)))
print(max(num))

### FIXED CODE ###

n = int(input())
s = input()
num = []
for i in range(n):
  a = set(s[:i])
  b = set(s[i:])
  num.append(len(a.intersection(b)))
print(max(num))
import sys
input = sys.stdin.readline

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

xl.sort(key=lambda x:x[1])

cnt = [None]*(10**9)
ans = [0 for _ in range(n)]

for i in range(n):
    for j in range(xl[i][0] - xl[i][1] + 1, xl[i][0] + xl[i][1]):
        if cnt[j] == None:
            cnt[j] = 1
        else:
            break
        if j == xl[i][0] + xl[i][1]-1:
            ans[i] = 1

print(sum(ans))


### FIXED CODE ###

import sys
input = sys.stdin.readline

n = int(input())
xl = [list(map(int, input().split())) for _ in range(n)]
xl2 = sorted([[x + l, x - l] for x, l in xl])

ans = 0
mr = xl2[0][1]
for r, l in xl2:
    if l >= mr:
        ans += 1
        mr = r
print(ans)
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    MOD = 1000000007
    N, *A = map(int, read().split())
    C = [0] * N
    C[0] = 3
    ans = 1
    for a in A:
        ans = ans * C[a] % MOD
        if ans == 0:
            print(0)
            return
        C[a] -= 1
        C[a + 1] += 1

    print(ans)

    return


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    MOD = 1000000007
    N, *A = map(int, read().split())
    seq = [-1] * 3
    ans = 1
    try:
        for a in A:
            ans = ans * seq.count(a - 1) % MOD
            seq[seq.index(a - 1)] = a
        print(ans)
    except:
        print(0)
        
    return


if __name__ == '__main__':
    main()
a = 1
x = input()
for i in x:
    if i ==0:
        continue
    print('Case',a,':',x)
    a += 1

### FIXED CODE ###

count = 1
while True:
    x = input()
    if int(x) == 0:
        break
    else:
        print('Case ' + str(count) + ': ' + str(x))
        count += 1
import sys
sys.setrecursionlimit(10**6)

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

balls=[]
for i in range(N):
  balls.append( [int(i) for i in input().split()])

salist=[]
for i in range(1,len(balls),1):
  sax = balls[i][0]-balls[i-1][0]
  say = balls[i][1]-balls[i-1][1]
  salist.append([sax,say])
  
sa_uniq=[]
for x in salist:
  if x not in sa_uniq:
    sa_uniq.append(x)

balls.reverse()
costs=[]
for i,sa in enumerate(reversed(sa_uniq)):
  cost=1
  for i in range(0,len(balls)-1,1):
    if balls[i+1][0]!=balls[i][0]-sa[0] and balls[i+1][1]!=balls[i][1]-sa[1]:
      cost+=1
  costs.append(cost)

print(min(costs))

### FIXED CODE ###

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

balls=[]
for i in range(N):
  balls.append( [int(i) for i in input().split()])

ans=0
for i in range(0,N-1):
  for j in range(i+1,N):
    sax = balls[j][0]-balls[i][0]
    say = balls[j][1]-balls[i][1]
    merge=0
    for k in range(0,N):
      if([balls[k][0]+sax,balls[k][1]+say] in balls):
          merge+=1
    ans=max(ans,merge)
print(N-ans)
n, t = map(int, input().split())
c_lists = []
t_lists = []
for i in range(n):
  c_i, t_i = map(int, input().split())
  c_lists.append(c_i)
  t_lists.append(t_i)

costs = []
for j in range(n):
    if t_lists[j] <= t:
        costs.append(c_lists[j])
if not costs:
    ans = 'TLE'
else:
    minimum = costs[0]
    for k in costs:
        if k < minimum:
            minimum = k
            ans = k
print(ans)

### FIXED CODE ###

n, t = map(int, input().split())
c_lists = []
t_lists = []
for i in range(n):
  c_i, t_i = map(int, input().split())
  c_lists.append(c_i)
  t_lists.append(t_i)

costs = []
for j in range(n):
    if t_lists[j] <= t:
        costs.append(c_lists[j])
if not costs:
    ans = 'TLE'
else:
    costs.sort()
    ans = costs[0]
print(ans)
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

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

x = list(map(int, input().split()))
x.append(X)
x.sort()

res = [abs(x[i+1]-x[i]) for i in range(len(x))]
print(gcd(*res))

### FIXED CODE ###

import math
from functools import reduce
 
def gcd(*numbers):
    return reduce(math.gcd, numbers)

N, X = list(map(int, input().split()))
 
x = list(map(int, input().split()))
x.append(X)
x.sort()
 
res = [abs(x[i+1]-x[i]) for i in range(len(x)-1)]
print(gcd(*res))
x, y, z = map(int, input())
print(z, x, y)


### FIXED CODE ###

x, y, z = map(int, input().split())
print(z, x, y)
import numpy as np

def iterate(mapdata, passed, curr, count):
    if curr == (passed.shape[0] - 1, passed.shape[1] - 1):
        return count

    if mapdata[curr[0]][curr[1]] == '#':
        return 100000 #passed[curr]
    
    if passed[curr] > 0:
        return 100000 #passed[curr]
    passed[curr] = 1
    
    ret = 100000
    if curr[0] < passed.shape[0] - 1:
        tmp = iterate(mapdata, passed, (curr[0] + 1, curr[1]), count + 1)
        ret = min(ret, tmp)
    if curr[1] < passed.shape[1] - 1:
        tmp = iterate(mapdata, passed, (curr[0], curr[1] + 1), count + 1)
        ret = min(ret, tmp)
    if curr[0] > 0:
        tmp = iterate(mapdata, passed, (curr[0] - 1, curr[1]), count + 1)
        ret = min(ret, tmp)
    if curr[1] > 0:
        tmp = iterate(mapdata, passed, (curr[0], curr[1] - 1), count + 1)
        ret = min(ret, tmp)

    return ret


h, w = map(int, input().split())
mapdata = [input() for y in range(h)]
dotsum = sum(mapdata[y].count('.') for y in range(h))

passed = np.zeros((h, w), np.int32)
#passed[:, :] = 100000
count = iterate(mapdata, passed, (0, 0), 0)
#print(count)
if count < 100000:
    print(dotsum - count - 1)
else:
    print(-1)

### FIXED CODE ###

import numpy as np

def iterate2(mapdata, passed, start):
    queue = [(start, 0)]

    while len(queue) > 0:
        curr, count = queue[0]
        del queue[0]
        if curr == (passed.shape[0] - 1, passed.shape[1] - 1):
            return count
        if mapdata[curr[0]][curr[1]] == '#':
            continue
        if passed[curr] > 0:
            continue
        passed[curr] = 1

        if curr[0] < passed.shape[0] - 1:
            queue.append(((curr[0] + 1, curr[1]), count + 1))
        if curr[1] < passed.shape[1] - 1:
            queue.append(((curr[0], curr[1] + 1), count + 1))
        if curr[0] > 0:
            queue.append(((curr[0] - 1, curr[1]), count + 1))
        if curr[1] > 0:
            queue.append(((curr[0], curr[1] - 1), count + 1))
    
    return -1

h, w = map(int, input().split())
mapdata = [input() for y in range(h)]
dotsum = sum(mapdata[y].count('.') for y in range(h))

passed = np.zeros((h, w), np.int8)
count = iterate2(mapdata, passed, (0, 0))
#print(dotsum)
#print(count)
if count > 0:
    print(dotsum - count - 1)
else:
    print(-1)
ab=[sum(map(int, input().split())) for i in range(int(input()))]
ab.sort(reversed=1)
print(ab[::2]-ab[1::2])

### FIXED CODE ###

#A
"""
n, a, b = map(int, input().split())
ab = n / 2
ansa = min(a, b)
ansb = max((a+b)-n, 0)
print(ansa,ansb)
"""

#B
"""
n = int(input())
a = input()
b = input()
c = input()
ans = 0
for i in range(n):
    bf = [a[i], b[i], c[i]]
    bf = set(bf)
    ans += len(bf) - 1
print(ans)
"""

#C 

n = int(input())
ab = []
aba = []
abb = []
for i in range(n):
    a,b = map(int, input().split())
    ab.append([a + b, i])
    aba.append(a)
    abb.append(b)
ab.sort(reverse = True, key = lambda x:x[0])
ans = 0
for i in range(n):
    if i % 2 == 0:
        ans += aba[ab[i][1]]
    else:
        ans -= abb[ab[i][1]]
print(ans)


#D
"""
n, m = map(int, input().split())
ab = [[] for _ in range(n)]
for i in range(n + m - 1):
    a,b = map(int, input().split())
    ab[a-1].append(b-1)
print(ab)
ans = [0 for i in range(n)]
def yosozero(i):
    if ans[i]
"""
a,b,c = map(int,input().split())
if(a==b and b==c):
  print(1)
else if( a!=b and b!=c and c!=a):
  print(3)
else:
  print(2)

### FIXED CODE ###

a,b,c = map(int,input().split())
if(a==b and b==c):
  print(1)
elif( a!=b and b!=c and c!=a):
  print(3)
else:
  print(2)
a,b,c=map(int,input().split())
print("A",b[0],"C")

### FIXED CODE ###

print("A"+input()[8]+"C")
s = input()
i = 0
while i < 100 and i < len(s):
    if s[i] != "R" and s[i] != "U" and s[i] != "D":
        print(i)
        print(s[i])
        print("1No")
        sys.exit()
    i += 2
i = 1
while i < 100 and i < len(s):
    if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
        print(s[i])
        print("2No")
        sys.exit()
    i += 2

print("Yes")


### FIXED CODE ###

import sys

s = input()
i = 0
while i < 100 and i < len(s):
    if s[i] != "R" and s[i] != "U" and s[i] != "D":
        print("No")
        sys.exit()
    i += 2
i = 1
while i < 100 and i < len(s):
    if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
        print("No")
        sys.exit()
    i += 2

print("Yes")
n, m, x = map(int, input().split())
#n,m,x,i,j,l,money,k,o
books = []
for i in range(n):
    books.append(list(map(int, input().split())))
books = sorted(books, reverse=False)
print(books)#

ans = 10 ** 6
import itertools
for i in range(n+1):
    for j in itertools.combinations(books, i):#j:組み合わせ
#        print(j)#
        l = [0] * n #理解度
        money = 0
        for k in j:#k:組み合わせの中の１冊
#            print(k)#
            money += k[0]  #費用
#            print(money)#
            for o in range(1, m + 1):
                l[o-1] += k[o]  #lが理解度、kが本
#        print(money,l)
        if all(a >=x for a in l):
            if money < ans:
                ans = money

if ans == 10 ** 6:
    print(-1)
else:
    print(ans)

### FIXED CODE ###

n, m, x = map(int, input().split())
#n,m,x,i,j,l,money,k,o
books = []
for i in range(n):
    books.append(list(map(int, input().split())))
books = sorted(books, reverse=False)
#print(books)#

ans = 10 ** 10000
import itertools
for i in range(n+1):
    for j in itertools.combinations(books, i):#j:組み合わせ
#        print(j)#
        l = [0] * m #理解度
        money = 0
        for k in j:#k:組み合わせの中の１冊
#            print(k)#
            money += k[0]  #費用
#            print(money)#
            for o in range(1, m + 1):
                l[o-1] += k[o]  #lが理解度、kが本
#        print(money,l)#
        if all(a >=x for a in l):
            if money < ans:
                ans = money

if ans == 10 ** 10000:
    print(-1)
else:
    print(ans)
1
11 11

### FIXED CODE ###

K = int(input())
A,B = map(int,input().split())
a = A// K
b = B // K
if a != b and a !=0 or A % K == 0 or B % K ==0:
    print('OK')
else:
    print('NG')
a = int(input())

for i in range(int(i**0.5),0,-1):
    if a % i == 0:
        print(int(a/i + i -2))
        break


### FIXED CODE ###

a = list(map(int, input().split()))
if 1<=a[0] and a[0]<=9:
    if 1<=a[1] and a[1]<=9:
        print(a[0]*a[1])
    else:
        print(-1)
else:
    print(-1)
a=input()
b=input()
cnt=0
passw=''
if (len(a)-len(b))==1:
  while 1:
      passw=passw+a[cnt]+b[cnt]
      cnt=cnt+1
      if (cnt+1)>len(b):
        passw=passw+a[cnt+1]
        break
else:
  while 1:
      passw=passw+a[cnt]+b[cnt]
      cnt=cnt+1
      if (cnt+1)>len(b):
        break
print(passw)

### FIXED CODE ###

a=input()
b=input()
cnt=0
passw=''
if (len(a)-len(b))==1:
  while 1:
      passw=passw+a[cnt]+b[cnt]
      cnt=cnt+1
      if (cnt+1)>len(b):
        passw=passw+a[cnt]
        break
else:
  while 1:
      passw=passw+a[cnt]+b[cnt]
      cnt=cnt+1
      if (cnt+1)>len(b):
        break
print(passw)
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import combinations, permutations, product
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

#############
# Main Code #
#############

def less_than(array, x):
    # arrayの中のx未満のものの個数
    # arrayの中のx未満のもののうちの最大値
    index = bisect_left(array, x)
    if index == 0:
        less_than_int = -float('inf')
    else:
        less_than_int = array[index - 1]
    return [index, less_than_int]

N = getN()
up = getList()
up.sort()
mid = getList()
mid.sort()
low = getList()
low.sort()

# 中段のパーツに載せられる上段のパーツの数
mid_imos = [0] * 6
for i in range(N):
    mid_imos[i] = less_than(up, mid[i])[0]

for i in range(N - 1):
    mid_imos[i + 1] += mid_imos[i]

low_imos = [0] * 6
for i in range(N):
    ind = less_than(mid, low[i])[0]
    if ind > 0:
        low_imos[i] = mid_imos[ind - 1]
print(sum(low_imos))


### FIXED CODE ###

from bisect import bisect_left
n = int(input())
listtop = sorted(list(map(int, input().split())))
listmiddle = sorted(list(map(int, input().split())))
listbottom = sorted(list(map(int, input().split())))
sum = 0

# 最初0があるので注意
# 0~N個目に乗せられるパーツの合計（累積和）
listmiddlesum = [0]
for i in range(n):
    # ride:n個目に乗せられるlisttopのパーツの数
    ride = bisect_left(listtop, listmiddle[i])
    listmiddlesum.append(listmiddlesum[i] + ride)
for i in range(n):
    ridesum = bisect_left(listmiddle, listbottom[i])
    sum += listmiddlesum[ridesum]
print(sum)
h = list(input() for i in range(3))
hand = {'a':h[0], 'b':h[1], 'c':h[2]}   # 各手札
count = {'a':0, 'b':0, 'c':0}   # 捨てた枚数

def who_is_the_winner(ch):
    if ch == 'a':
        winner = 'A'
    elif ch == 'b':
        winner = 'B'
    else:
        winner = 'C'
    return winner

ch = hand['a'][0]
while True:
    if count[ch] == len(hand[ch]):
        winner = who_is_the_winner(ch)
        print(winner)
        break
    count[ch] += 1
    ch = hand[ch][count[ch]-1]

### FIXED CODE ###

a = [int(input()) for i in range(3)]
ans = ((a[0]+a[1]) * a[2]) / 2

print(str(int(ans)))
def woo(x, y):
    res = [0 for i in range(1, x)]
    z = list(map(int, input().split()))
    for i in range(1, x):
        res[i] = min(abs(z[i] - z[j]) + res[j] for j in range(max(0, i - y), i))
    return res

if __name__ == '__main__':
    x, y = map(int, input().split())
    r = woo(x, y)
    f = len(r)-1
    print(r[f])



### FIXED CODE ###

from sys import stdin
n, k = [int(i) for i in stdin.readline().split(' ')]
h = [int(i) for i in stdin.readline().split(' ')]

minCosts = [0, abs(h[1]-h[0])]
for i in range(2, len(h)):
    minCosts.append(min([abs(h[i]-h[i-j])+minCosts[i-j] for j in range(1, min(i, k)+1)]))

print(minCosts[-1])
#!/usr/local/bin/python3
# https://atcoder.jp/contests/abc064/tasks/abc064_c


def check(a):
    if 1 <= a < 400:
        return 0
    elif 400 <= a < 799:
        return 1
    elif 800 <= a < 1199:
        return 2
    elif 1200 <= a < 1599:
        return 3
    elif 1600 <= a < 1999:
        return 4
    elif 2000 <= a < 2399:
        return 5
    elif 2400 <= a < 2799:
        return 6
    elif 2800 <= a < 3199:
        return 7
    elif 3200 <= a:
        return 8


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

ratings = [
    '1-399', '400-799', '800-1199', '1200-1599', '1600-1999',
    '2000-2399', '2400-2799', '2800-3199', '3200-']
d = {r: 0 for r in ratings}

for a in A:
    d[ratings[check(a)]] += 1

ans = 0
for k, v in d.items():
    if k != '3200-' and v != 0:
        ans += 1

top = d['3200-']
if top == 0:
    print(ans, ans)
elif ans == 0:
    print(1, min(8, top))
else:
    print(ans, ans+min(8, top))


### FIXED CODE ###

#!/usr/local/bin/python3
# https://atcoder.jp/contests/abc064/tasks/abc064_c


def check(a):
    if a < 400:
        return 0
    elif a < 800:
        return 1
    elif a < 1200:
        return 2
    elif a < 1600:
        return 3
    elif a < 2000:
        return 4
    elif a < 2400:
        return 5
    elif a < 2800:
        return 6
    elif a < 3200:
        return 7
    else:
        return 8


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

ratings = [
    '1-399', '400-799', '800-1199', '1200-1599', '1600-1999',
    '2000-2399', '2400-2799', '2800-3199', '3200-']
d = {r: 0 for r in ratings}

for a in A:
    d[ratings[check(a)]] += 1

ans = 0
for k, v in d.items():
    if k != '3200-' and v != 0:
        ans += 1

top = d['3200-']
if top == 0:
    print(ans, ans)
elif ans == 0:
    print(1, top)
else:
    print(ans, ans+top)
n=int(input())
alis=list(map(int,input().split()))
xlis=set()
for i in alis:
    xlis.add(i-1)
    xlis.add(i+1)
    xlis.add(i)
#print(xlis)
counter=[0 for _ in range(len(xlis))]
t=-1
for x in xlis:
    t+=1
    for i in range(n):
        if x-1<=alis[i] and alis[i]<=x+1:
            counter[t]+=1
print(max(counter))

### FIXED CODE ###

x,t=map(int,input().split())
print(max(0,x-t))