Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

from itertools import combinations

n = int(input())
s = input()
c = set()

for sc in combinations(map(int, list(s)), 3):
    c.add(sc)

print(len(c))



### FIXED CODE ###

from itertools import product

n = int(input())
s = input()

ans = 0

for cmb in product(range(10), range(10), range(10)):
    idx = -1
    for i in cmb:
        idx = s.find(str(i), idx + 1)
        if idx < 0:
            break
    else:
        ans += 1

print(ans)
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
m = A[0]
c = 0

for i in range(1, N):
    if i <  m+A[i]:
        m = min(m, A[i])
    else:
        for j in range(0, i):
            if A[i] + A[j] == i - j:
                c += 1
        m = min(m, A[i])

print(c)

### FIXED CODE ###

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

L = [ i+1+A[i] for i in range(N) ]
R = [j+1-A[j] for j in range(N) ]

Ld = {}
Rd = {}

for i in range(N):
    if R[i] in Rd.keys():
        Rd[R[i]] += 1
    else:
        Rd[R[i]] = 1

ans = 0
for i in range(N):
    if L[i] in Rd.keys():
        ans += Rd[L[i]]
    if L[i] == R[i]:
        ans -= 1
        
print(ans)
### BUGGY CODE ###

n,a = map(int, input().split())
x = list(map(int, input().split()))
for i in range(n):
    x[i] -= a
lis = []
for i in range(2**n):
    d = list(map(int, list(bin(i))[2:]))
    while len(d) < n:
        d.insert(0,0)
    lis.append(d)
ans = -1
for i in lis:
    su = 0
    for j in range(n):
        su += i[j]*x[j]
    if su == 0:
        ans += 1
print(ans)

### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,a = LI()
    x = LI()
    m = 2501
    d = [[0]*m for i in range(n+1)]
    d[0][0] = 1
    for xi in x:
        for i in range(n)[::-1]:
            ni = i+1
            for j in range(m):
                if not d[i][j]:
                    continue
                k = j+xi
                if k >= m:
                    break
                d[ni][k] += d[i][j]
    ans = 0
    for i in range(1,n+1):
        k = a*i
        if k < m:
            ans += d[i][k]
    print(ans)
    return

#Solve
if __name__ == "__main__":
    solve()
### BUGGY CODE ###

import math
K = int(input())
ans = 0

for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            ans += math.gcd(math.gcd(i,j),k)
print(ans)

### FIXED CODE ###

import math
K = int(input())
ans = 0

for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            ans += math.gcd(math.gcd(i,j),k)
print(ans)
### BUGGY CODE ###

N = int(input())
S = str(input())

ans = 0
for k in range(3,N+1):
    for j in range(2,k):
        if S[k-1] != S[j-1]:
            for i in range(1,j):
                if S[k-1] != S[i-1] and S[j-1] != S[i-1] and j-i != k-j:
                    ans += 1

print(ans)

### FIXED CODE ###

N = int(input())
S = str(input())

r_cnt = S.count('R')
g_cnt = S.count('G')
b_cnt = S.count('B')

ans = r_cnt*g_cnt*b_cnt

for i in range(N):
    for d in range(1, N):
        j = i + d
        k = j + d
        if k >= N:break
        if S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
            ans -= 1

print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
from collections import deque
def topological_sort(graph):
  count = 0
  in_cnt = {k:0 for k in nodes}
  for x in nodes:
    for y in graph[x]:
      in_cnt[y] += 1
  ret = []
  q = deque([i for i in nodes if not in_cnt[i]])
  newq = deque([])
  while q:
    x = q.popleft()
    ret.append(x)
    for y in graph[x]:
      in_cnt[y] -= 1
      if not in_cnt[y]:
        newq.append(y)
    if not q:
      q = newq
      newq = deque([])
      count += 1
  if [i for i in nodes if in_cnt[i]]:
    return None,count
  return ret,count

N = int(input().strip())
from itertools import combinations
nodes = list(combinations(range(N), 2))
graph = {i:set() for i in nodes}
for x in range(N):
  l = list(map(int,input().split()))
  y = l[0]-1
  prev = (min(x,y),max(x,y))
  for y in l[1:]:
    y -= 1
    now = (min(x,y),max(x,y))
    graph[prev].add(now)
    prev = now

ans,count = topological_sort(graph)
if not ans:
  print(-1)
else:
  print(count)

### FIXED CODE ###

import sys
input = sys.stdin.readline

N = int(input().strip())
M = N*(N-1)//2

graph = [[] for i in range(M)]
in_cnt = [0 for i in range(M)]
for x in range(1,N+1):
  l = list(map(int,input().split()))
  y = l[0]
  b,s = max(x,y),min(x,y)
  prev = (b-1)*(b-2)//2+s-1
  for y in l[1:]:
    b,s = max(x,y),min(x,y)
    now = (b-1)*(b-2)//2+s-1
    graph[prev].append(now)
    in_cnt[now] += 1 
    prev = now

d = [1 for k in range(M)]
q = [i for i in range(M) if not in_cnt[i]]

if not q:
  print(-1)
  exit()
ans = 0
while q:
  x = q.pop()
  for y in graph[x]:
    d[y] = max(d[y],d[x]+1)
    ans = max(ans,d[y])
    in_cnt[y] -= 1
    if not in_cnt[y]:
      q.append(y)
if [i for i in range(M) if in_cnt[i]]:
  print(-1)
  exit()

print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
n = int(input())
h = list(map(int,input().split()))
a,m = 0,0
for i in range(n-1):
  if m < n-i:
    for j in range(i+1,n):
      if h[j-1] >= h[j]:
        a += 1
        if j == n-1:
          m = max(m,a)
          a = 0
      else:
        m = max(m,a)
        a = 0
        break
print(m)

### FIXED CODE ###

import sys
input = sys.stdin.readline
n = int(input())
h = list(map(int,input().split()))

count,m = 0,0

for i in range(n-1):
  if h[i] >= h[i+1]:
    count += 1
  else:
    m = max(m,count)
    count = 0
m = max(m,count)
print(m)
### BUGGY CODE ###

#!/usr/bin/env python3
import re
n = int(input())
s = input()
ans = 0
for i in range(1000):
    t = '{:0=3}'.format(i)
    m = r'{}.*{}.*{}'.format(t[0], t[1], t[2])
    if re.search(m, s):
        ans += 1
print(ans)


### FIXED CODE ###

#!/usr/bin/env python3


def dfs(p, cur):
    sz = len(cur)
    if sz == 3:
        return
    for i in range(p + 1, n):
        nxt = cur + s[i]
        if nxt in used[sz]:
            continue
        used[sz][nxt] = True
        dfs(i, nxt)


n = int(input())
s = input()
used = [{} for _ in range(3)]

dfs(-1, "")

print(len(used[2]))
### BUGGY CODE ###

n, m, k = map(int, input().split())
mod = 998244353

ans = 0
comb = 1
for i in range(k+1):
  ans += (((m*pow(m-1,n-i-1,mod))%mod)*comb)%mod
  ans %= mod
  comb *= (n-1-i)
  comb //= i+1

print(ans)

### FIXED CODE ###

n, m, k = map(int, input().split())
mod = 998244353

ans = 0
comb = 1
for i in range(k+1):
  ans += (((m*pow(m-1,n-i-1,mod))%mod)*comb)%mod
  ans %= mod
  comb *= (n-1-i)
  comb %= mod
  comb *= pow(i+1, mod-2, mod)
  comb %= mod

print(ans)
### BUGGY CODE ###

import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


# Nの素因数分解を辞書で返す
def prime_fact(n):
    root = int(math.sqrt(n))
    prime_dict = {}
    for i in range(2, root+1):
        cnt = 0
        for j in range(root+1):
            if n % i == 0 and n != 0:
                cnt += 1
                n = n // i
            else:
                break
        if cnt:
            prime_dict[i] = cnt
    if n != 1:
        prime_dict[n] = 1
    return prime_dict


def main():
    N = NI()
    A = NLI()
    L = {}
    B = [0] * N
    primes_a = {}
    for a in A:
        prime_a = prime_fact(a)
        primes_a[a] = prime_a
        for p, n in prime_a.items():
            L.setdefault(p, 0)
            L[p] = max(L[p], n)
    for i, a in enumerate(A):
        b = 1
        for p, n in L.items():
            primes_a[a].setdefault(p, 0)
            b *= p ** (n - primes_a[a][p])
        B[i] = b
    print(sum(B) % MOD)



if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


# Nの素因数分解を辞書で返す
def prime_fact(n):
    root = int(math.sqrt(n))
    prime_dict = {}
    for i in range(2, root+1):
        cnt = 0
        for j in range(root+1):
            if n % i == 0 and n != 0:
                cnt += 1
                n = n // i
            else:
                break
        if cnt:
            prime_dict[i] = cnt
    if n != 1:
        prime_dict[n] = 1
    return prime_dict


def main():
    N = NI()
    A = NLI()
    L = {}
    primes_a = {}
    for a in A:
        prime_a = prime_fact(a)
        primes_a[a] = prime_a
        for p, n in prime_a.items():
            L.setdefault(p, 0)
            L[p] = max(L[p], n)
    ans = 0
    l = 1
    for p, n in L.items():
        l = l * pow(p, n, MOD) % MOD

    for i, a in enumerate(A):
        ans += l * pow(a, MOD-2, MOD) % MOD
    print(ans % MOD)



if __name__ == "__main__":
    main()
### BUGGY CODE ###

from fractions import gcd
import sys

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

a = 1
result = []
for x in arr:
    y = gcd(a, x)
    result.append(y)
    a = a * x // y


if result.count(1) == len(arr):
    print("pairwise coprime")
    sys.exit()

a = 1
result2 = []
for x in result[1:]:
    y = gcd(a, x)
    result2.append(y)
    a = a * x // y

if result2.count(1) == len(arr) - 1:
    print("setwise coprime")
else:
    print("not coprime")

### FIXED CODE ###

import numpy as np
from numba import njit


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


n = 10**6 + 1
primes = set(range(3, n+1, 2))

for i in range(3, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes.add(2)


@njit
def solve(arr, primes):
    cnt = np.bincount(arr)
    for p in primes:
        if (cnt[p::p]).sum() > 1:
            return False
    else:
        return True


if np.gcd.reduce(arr) != 1:
    print("not coprime")
elif solve(arr, primes):
    print("pairwise coprime")
else:
    print("setwise coprime")
### BUGGY CODE ###

n = int(input())
a_list = []
for i in range(n):
	a_list.append(int(input()))
r = -1
num = 1
nums = [1]
count = 0
while True:
	num = a_list[num-1]
	count += 1
	if num in nums:
		break
	if num == 2:
		r = count
		break
	if count > n:
		break
	nums.append(num)
print(r)

### FIXED CODE ###

n = int(input())
a_list = []
for i in range(n):
	a_list.append(int(input()))
r = -1
num = 1
count = 0
while True:
	num = a_list[num-1]
	count += 1
	if num == 2:
		r = count
		break
	if count == n:
		break
print(r)
### BUGGY CODE ###

S = input()
ans = 0
for i in range(0, len(S)-3):
    for j in range(i+3, len(S)):
        if int(S[i:j+1])%2019 == 0:
            ans += 1
print(ans)

### FIXED CODE ###

S = input() [::-1]
ans = 0
mod = 0
ten = 1
count = [0]* 2019
count[0] = 1
for i in range(len(S)):
    mod = (mod + int(S[i]) * ten) % 2019
    ten = ten*10 % 2019
    count[mod] += 1
for c in count:
    ans += c*(c-1)//2
print(ans)
### BUGGY CODE ###

import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline.rstrip()
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplt(n): return [tuple(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
A = inpl()
B = sorted(inpl())
C = sorted(inpl())

ans = 0
d = defaultdict(int)
for b in B:
    d[b] = len(C[bisect.bisect_right(C,b):])
for a in A:
    for b in B[bisect.bisect_right(B,a):]:
        ans += d[b]

print(ans)

### FIXED CODE ###

import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplt(n): return [tuple(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
A = sorted(inpl())
B = sorted(inpl())
C = sorted(inpl())

ans = 0
for b in B:
    tmp = bisect.bisect_right(C,b)
    tmp2 = bisect.bisect_left(A,b)
    ans += (n-tmp) * tmp2

print(ans)
### BUGGY CODE ###

N,M=map(int,input().split())
counter=0
for a in range(N+1):
  for b in range(N+1):
    for c in range(N+1):
      if a+b+c==M:
        counter+=1
print(counter)

### FIXED CODE ###

N,M=map(int,input().split())
counter=0
for a in range(N+1):
  for b in range(N+1):
    if 0<=M-(a+b)<=N:
      counter+=1
print(counter)
### BUGGY CODE ###

from sys import stdin

# input
n,m = [int(x) for x in stdin.readline().rstrip().split()]
r = {}
#a = []
#b = []
for i in range(n):
    tmp = [int(x) for x in stdin.readline().rstrip().split()]
    if tmp[0] not in r:
        r[tmp[0]] = []
    r[tmp[0]].append(tmp[1])
    #a.append(tmp[0])
    #b.append(tmp[1])

result = 0
for i in range(m):
    v = 0
    tmp_key = None
    tmp_i = None
    for j in range(i+1):
        l = j+1
        if l in r:
            if max(r[l]) > v:
                tmp_key = l
                tmp_i = r[l].index(max(r[l]))
                v = r[l][tmp_i]
    if tmp_key is not None:
        del r[tmp_key][tmp_i]
        if len(r[tmp_key]) == 0:
            del r[tmp_key]
        result += int(v)

print(result)

### FIXED CODE ###

from collections import defaultdict, Counter
from heapq import heapify, heappop, heappush
from sys import stdin
 
def main():
    n, m = map(int, input().split())
    dd = defaultdict(list)
    for _ in range(n):
        a, b = map(int, input().split())
        dd[a].append(b)
    
    ans = 0
    heap = []
    for i in range(1, m+1):
        if i in dd:
            for v in dd[i]:
                heappush(heap, v*-1)
        if len(heap) > 0:
            ans += -1 * heappop(heap)

    print(ans)
 
input = lambda: stdin.readline().rstrip()
main()
### BUGGY CODE ###

s=str(input())
s=list(s)
temp=0
for i in range(0,len(s)):
  if s[i]=="B":
    for j in range(i+1,len(s)):
      if s[j]=="W":
        temp=temp+1
print(temp)

### FIXED CODE ###

s=str(input())
s=list(s)
count=0
temp=0
for i in range(len(s)):
  if s[i]=="W":
    temp=temp+i-count
    count=count+1
print(temp)
### BUGGY CODE ###

n,*a=map(int,open(0).read().split())
a.sort()
i = 0
while i<len(a):
    a = [a[i]]*(a.count(a[i])==1) + list(filter(lambda x: x%a[i] >0,a)) 
    i+=1
print(len(a))

### FIXED CODE ###

_,*a = map(int, open(0).read().split())
a.sort()
m = -~a[-1]
c = [0]*m
for i in a:
    c[i] += 1
    if c[i] > 1:
        continue
    for j in range(i * 2, m, i):
        c[j] = 2
print(sum(c[i]==1for i in a))
### BUGGY CODE ###

from collections import Counter
n = int(input())
nums = list(map(int, input().split()))
q = int(input())
vals = [tuple(map(int, input().split())) for _ in range(q)]

c = Counter(nums)

for b, k in vals:
    o = c[b]
    del c[b]
    c[k] += o
    total = sum([x*y for x, y in c.items()])
    print(total)

### FIXED CODE ###

from collections import Counter
n = int(input())
nums = list(map(int, input().split()))
q = int(input())
vals = [tuple(map(int, input().split())) for _ in range(q)]

c = Counter(nums)
total = sum([x*y for x, y in c.items()])
for b, k in vals:
    o = c[b]
    del c[b]
    c[k] += o
    total += k * o - b * o
    print(total)
### BUGGY CODE ###

n = int(input())
x = [int(i) for i in input().split()]
for i in range(n):
  y = x.copy()
  del y[i]
  y = sorted(y)
  print(y[int( n/2-1 )])

### FIXED CODE ###

n = int(input())
x = [int(i) for i in input().split()]
y = sorted(x)
m1 = y[int(n/2-1)]
m2 = y[int(n/2)]
if m1==m2:
  for i in x:
    print(m1)
else:
  for i in x:
    if m2 > i:
      print(m2)
    elif i > m1:
      print(m1)
### BUGGY CODE ###

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

def dp(H,N,ls):
    table=[[float('inf')]*(H+1)] + [[0]*(H+1) for i in range(N)]
    for i in range(1,N+1):
        atk,cost=ls[i-1][0],ls[i-1][1]
        for h in range(H+1):
            if atk>=h:
                table[i][h]=min(table[i-1][h], cost)
            else:
                table[i][h]=min(table[i-1][h], table[i][h-atk]+cost)
    return(table[-1][-1])

print(dp(H,N,ls))


### FIXED CODE ###

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

def dp(h,n,ls):
    table=[[0]*(h+1) for i in range(n)]
    atk,cost=ls[0][0],ls[0][1]
    for x in range(h+1):
        cost_of_this = cost*((x-1)//atk+1) if x!=0 else cost
        table[0][x]=cost_of_this
    for i in range(1,n):
        atk,cost=ls[i][0],ls[i][1]
        for j in range(h+1):
            if atk>=j:
                table[i][j]=min(table[i-1][j], cost)
            else:
                table[i][j]=min(table[i-1][j], table[i][j-atk]+cost)
    return(table[-1][-1])

ans=dp(h,n,ls)
print(ans)
### BUGGY CODE ###

a, b, q = map(int, input().split())
S = [int(input()) for _ in range(a)]
T = [int(input()) for _ in range(b)]
S.sort()
T.sort()
S = [-float('inf')] + S + [float('inf')]
T = [-float('inf')] + T + [float('inf')]

import bisect
for _ in range(q):
    x = int(input())
    i = bisect.bisect_right(S, x)
    j = bisect.bisect_right(T, x)
    ans = float('inf')
    for s in [S[i-1], S[i]]:
        for t in [T[j-1], T[j]]:
            d1 = abs(s-x) + abs(t-s)
            d2 = abs(t-x) + abs(s-t)
            ans = min([ans, d1, d2])
    print(ans)

### FIXED CODE ###

a, b, q = map(int, input().split())
S = [int(input()) for _ in range(a)]
T = [int(input()) for _ in range(b)]
S.sort()
T.sort()
INF = 10**18
S = [-INF] + S + [INF]
T = [-INF] + T + [INF]

import bisect
for _ in range(q):
    x = int(input())
    i = bisect.bisect_right(S, x)
    j = bisect.bisect_right(T, x)
    ans = INF
    for s in [S[i-1], S[i]]:
        for t in [T[j-1], T[j]]:
            d1 = abs(s-x) + abs(t-s)
            d2 = abs(t-x) + abs(s-t)
            ans = min([ans, d1, d2])
    print(ans)
### BUGGY CODE ###

N, W = map(int, input().split())
w, v = [0] * N, [0] * N
for i in range(N):
	w[i], v[i] = map(int, input().split())
dp = [[0] * (W + 1) for _ in range(N + 1)]
for i in range(N):
  for j in range(W+1):
    if j>=w[i]:
      dp[i+1][j]=max(dp[i][j] ,dp[i][j-w[i]] +v[i] )
    else:
      dp[i+1][j]=dp[i][j]
print(dp[N][W])

### FIXED CODE ###

N, W = map(int, input().split())
w, v = [0] * N, [0] * N
for i in range(N):
	w[i], v[i] = map(int, input().split())
dp = [[0] * (W + 1) for _ in range(N + 1)]
for i in range(N):
  for j in range(W+1):
    if j>=w[i]:
      dp[i+1][j]=max(dp[i][j] ,dp[i][j-w[i]] +v[i] )
    else:
      dp[i+1][j]=dp[i][j]
print(dp[N][W])
### BUGGY CODE ###

import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
n ,k = i2()
p = intl()
def sx(n):
    return (n+1)/2

m = 0
pnt = 0
for i in range(0,n-k+1):
    s = sum(p[i:i+k])
    if s > m:
        m = s
        pnt = i
cnt = 0
for j in range(pnt,pnt+k):
    cnt += sx(p[j])
print(cnt)

### FIXED CODE ###

import sys
import math
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    n,k = I2()
    p = Intl()
    s = 0
    for i in range(k):
        s += (p[i] + 1)/2
    ans = s
    for i in range(k,n):
        s += (p[i] + 1)/2
        s -= (p[i-k] + 1)/2
        ans = max(ans,s)
    print(ans)
### BUGGY CODE ###

mass = int(input())
buildings = list(int(i) for i in input().split())
move_history = []

for place in range(mass):
  now = place
  move_num = 0
  for move in range(mass-(place+1)):
    if buildings[now] >= buildings[now+1]:
      move_num += 1
      now += 1
    else:
      break
  move_history.append(move_num)
print(max(move_history))

### FIXED CODE ###

import numpy as np

mass = int(input())
buildings = np.array(list(int(i) for i in input().split()))
move_count = 0
max_move = 0

for i in range(mass-1):
  if buildings[i] >= buildings[i+1]:
    move_count += 1
  else:
    if move_count > max_move:
      max_move = move_count
    move_count = 0
  if move_count > max_move:
    max_move = move_count

print(max_move)
### BUGGY CODE ###

# author:  Taichicchi
# created: 12.09.2020 19:26:19

import sys

N, Q = map(int, input().split())

S = input()

cum_ls = []


def cnt_ac(s):
    cnt = 0
    for i in range(N - 1):
        if s[i:i + 2] == "AC":
            cnt += 1
    return cnt


for i in range(N):
    cum_ls.append(cnt_ac(S[:i + 1]))

for i in range(Q):
    l, r = map(int, input().split())
    print(cum_ls[r - 1] - cum_ls[l - 1])


### FIXED CODE ###

# author:  Taichicchi
# created: 12.09.2020 19:26:19

import sys

N, Q = map(int, input().split())

S = input()

cum_ls = [0]

for i in range(1, N):
    if S[i - 1: i + 1] == "AC":
        cum_ls.append(cum_ls[i - 1] + 1)
    else:
        cum_ls.append(cum_ls[i - 1])

# print(cum_ls)

for i in range(Q):
    l, r = map(int, input().split())
    print(cum_ls[r - 1] - cum_ls[l - 1])
### BUGGY CODE ###

n = int(input())

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

flg = 0
cnt = 0

for i in range(n):
    flg = 0
    for j in range(i):
        if j >= i:
            break
        else:
            if p_n[j] < p_n[i]:
                flg += 1
    
    if flg == 0:
        cnt += 1

print(cnt)

### FIXED CODE ###

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

cnt = 1
min_p = p[0]

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