Harryxun/stf_run huggingface dataset:
N = int(input())
words = [input() for i in range(N)]

if len(set(words)) != N:
    print("No")
    exit(1)
    
for i in range(1,len(words)):
    if words[i-1][-1] != words[i][0]:
        print("No")
        exit(1)

print("Yes")


### FIXED CODE ###

N = int(input())
words = []
l = []
for i in range(N):
    a = input()
    if i == 0:
        l.append(a)
        b = list(a)
        words.append(b[len(b)-1])
    elif i > 0:
        b = list(a)
        if i == N-1:
            words.append(b[0])
        else:
            words.append(b[0])
            words.append(b[len(b)-1])
        l.append(a)

if len(set(l)) != len(l):
    print("No")
    exit()

for h in range(0,len(words),2):
    if words[h] != words[h+1]:
        print("No")
        exit()
print("Yes")
s_d = input()
t = input()
for i in range(len(s_d) - len(t), -1, -1):
    possible = True
    for j in range(len(t)):
        if s_d[i + j] == t[j] or s_d[i + j] == "?":
            continue
        else:
            possible = False
            break
    if possible == False:
        continue
    else:
        s = s_d[:i] + t + s_d[i+len(t):]
        for k in range(len(s)):
            if s[k] == "?":
                s = s[:k] + "a" + s[k+1:]
        break
if possible == True:
    print(s)
else:
    print("UNRESTORABLE")

### FIXED CODE ###

s_d = input()
t = input()
if len(s_d) >= len(t):
    for i in range(len(s_d) - len(t), -1, -1):
        possible = True
        for j in range(len(t)):
            if s_d[i + j] == t[j] or s_d[i + j] == "?":
                continue
            else:
                possible = False
                break
        if possible == False:
            continue
        else:
            s = s_d[:i] + t + s_d[i+len(t):]
            for k in range(len(s)):
                if s[k] == "?":
                    s = s[:k] + "a" + s[k+1:]
            break
else:
    possible = False
if possible == True:
    print(s)
else:
    print("UNRESTORABLE")
a = input().split()
s= int(a[2]) // int(a[0)
print(s* int(a[1])


### FIXED CODE ###

a,b,c= input().split()
s= int(c) // int(a)
print(s* int(b))
x, y = map(int, input().split())

ans = 'No'
for i range(x+1):
  if (x*2 + (x-i)*4) == y:
    ans='Yes'
    break
print(ans)

### FIXED CODE ###

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

ans = 'No'
for i in range(x+1):
  if (i*2 + (x-i)*4) == y:
    ans='Yes'
    break
print(ans)
from itertools import combinations
L,R=map(int,input().split())
ans=L*R%2019
for i in combinations(range(L,R+1),2):
    if L!=0 and R!=0:
        if ans>=i[0]*i[1]%2019:
            ans=i[0]*i[1]%2019
    else:
        ans=0
print(ans)

### FIXED CODE ###

from itertools import combinations
L,R=map(int,input().split())
ans=L*R%2019
if R-L>=2018:
    print(0)
else:
    for i in combinations(range(L,R+1),2):
        if ans>=i[0]*i[1]%2019:
            ans=i[0]*i[1]%2019
    print(ans)
x, a, b = map(int, input().split())
print(x - a - b)

### FIXED CODE ###

x = int(input())
a = int(input())
b = int(input())
print((x - a) % b)
x=int(input())
if x=0:
    print(1)
else:
    print(0)

### FIXED CODE ###

x=int(input())
if x==0:
    print(1)
else:
    print(0)
while True:
    try:
        a, b, c, d, e, f = map(int, raw_input().split()) 
        x = float(c*e - b*f)/(a*e - b*d)
        y = float(c*d - a*f)/(b*d - a*e)
        print ("%f %f" % (round(x,-3), round(y,-3))
    except:
        break

### FIXED CODE ###

while True:
    try:
        a,b,c,d,e,f=map(float,raw_input().split())
        y=(d*c-a*f)*1.0/(d*b-a*e)
        print "%.3f %.3f" % ((c-b*y)/a, y)
    except:
        break
n, q = input().split()
Q = int(q)
s = input()
S = list(s)

array = []
count = 0
ff = False
for i in range(len(S)):
    if len(S) < i+1:
        break
    if S[i] == 'A':
        flag = True
        array.append(0)
    elif flag == True and S[i] == 'C':
        count += 1
        array.pop(-1)
        array.append(-1)
        array.append(count)
        ff = True
    elif flag == True:
        array.append(0)
        flag = False
    else:
        array.append(0)

array_q = []
for q in range(Q):
    l, r = input().split()
    array_q.append([int(l), int(r)])

for arr in array_q:
    if ff != True:
        print(0)
    if len(array[arr[0]-1:arr[1]-1]) < 2:
        print(0)
        continue
    for a in array[arr[0]-1:]:
        if a == -1:
            flag = True
        elif flag == True:
            minv = a
            break
    for b in reversed(array[:arr[1]]):
        if b != 0 and b != -1:
            maxv = b
            break
    if minv == maxv:
        print(1)
    else:
        print(maxv - minv + 1)


### FIXED CODE ###

h = input()
S = list(h)

atc = ['A', 'T', 'C', 'G']

flag = False
count = 0
maxt = 0
for i in range(len(S)):
    for s in range(len(S)):
        s = s + i
        if len(S) <= s:
            if maxt <= count:
                maxt = count
            break
        if flag == False and (S[s] in atc):
            flag = True
            count += 1
        elif flag == True and (S[s] in atc):
            count += 1
        elif flag == True:
            break
        if maxt < count:
            maxt = count
    count = 0
    flag = False
print(maxt)
N = input()
p=[]
max=0
for i in range(N):
    p.append(input())
    if max<=p:
        max=p[i]
sum=0
for i in range(N):
    sum+=p[i]
sum-=max
sum+=max/2
print(sum)


### FIXED CODE ###

N = int(input())
p=[]
max=0
for i in range(N):
    p.append(int(input()))
    if max<=p[i]:
        max=p[i]
sum=0
for i in range(N):
    sum+=p[i]
sum-=max
sum+=max/2
print(int(sum))
N,K,Q=map(int,input().split()) #Nは人の人数、Kはみなが最初に持っているポイント、Qはクイズの回数
L=[K]*N
for i in range(Q):
  m=int(input())-1
  for j in range(N):
    if j!=m:
      L[i]-=1
for k in range(N):
  if L[k]>0:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

N,K,Q=map(int,input().split()) #Nは人の人数、Kはみなが最初に持っているポイント、Qはクイズの回数
L=[K-Q]*N #
for i in range(Q):
    m=int(input())-1
    L[m]+=1
for k in range(N):
    if L[k]>0:
        print("Yes")
    else:
        print("No")
S=str(input())
T=str(input())
ls=len(S)
lt=len(T)
if ls<lt:
  print('UNRESTORABLE')

ans=''
for i in range(ls-lt,-1,-1):
  flag=0
  for j in range(lt):
    if not (S[i+j] == T[j] or S[i+j] == '?'):
      flag=1
      break
  if flag==0:
    loc=i
    break

if flag==1:
  print('UNRESTORABLE')
else:
  i=0
  while i<ls:
    if i==loc:
      ans+=T
      i+=lt
    elif S[i]=='?':
      ans+='a'
      i+=1
    else:
      ans+=S[i]
      i+=1
  print(ans)


### FIXED CODE ###

S=str(input())
T=str(input())
ls=len(S)
lt=len(T)

ans=''
loc=None
for i in range(ls-lt,-1,-1):
  flag=0
  for j in range(lt):
    if not (S[i+j] == T[j] or S[i+j] == '?'):
      flag=1
      break
  if flag==0:
    loc=i
    break

if loc == None:
  print('UNRESTORABLE')
else:
  i=0
  while i<ls:
    if i==loc:
      ans += T
      i += lt
    elif S[i] == '?':
      ans += 'a'
      i += 1
    else:
      ans += S[i]
      i += 1
  print(ans)
import sys
from bisect import *

input = sys.stdin.readline

def f(n, q):
    xst = []
    for i in range(n):
        s, t, x = map(int, input().split())
        xst.append([x, s - x, t - x])
    xst.sort()

    ds = []
    ans = [-1] * q
    for i in range(q):
        d = int(input())
        ds.append(d)

    for x, s, t in xst:
        st = bisect_left(ds, s)
        for i in range(st, q):
            if d[i] >= t:
                break
            if ans[i] == -1:
                ans[i] = x

    print(*ans, sep="\n")

n, q = map(int, input().split())
f(n, q)


### FIXED CODE ###

import sys
from bisect import *

input = sys.stdin.readline

def f(n, q):
    xst = []
    for i in range(n):
        s, t, x = map(int, input().split())
        xst.append([x, s - x, t - x])
    xst.sort()

    ds = []
    for i in range(q):
        d = int(input())
        ds.append(d)

    ans = [-1] * q
    jump = [-1] * q

    for x, s, t in xst:
        i = bisect_left(ds, s)
        fi = bisect_left(ds, t)
        while i < fi:
            if jump[i] != -1:
                i = jump[i]
            else:
                ans[i] = x
                jump[i] = fi
                i += 1

    print(*ans, sep="\n")

n, q = map(int, input().split())
f(n, q)
x = int(input())
t = int(input())

if t < x:
  print( x - t )
else:
  print( 0 )

### FIXED CODE ###

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


if t < x:
  print( x - t )
else:
  print( 0 )
def frac(n):
	r = 1
	for i in range(1,n+1):r*=i
	return(r)

def ans(n,k,i):
	if(n-k < i-1):return(0)
	r1 = frac(k-1) / frac(k-i) / frac(i-1)
	r2 = frac(n-k+1) / frac(n-k-i+1) / frac(i)
	
	return(r1*r2)

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



for i in range(1,k+1):
	print(int(ans(n,k,i))%1000000007)





### FIXED CODE ###

def frac(n):
	r = 1
	for i in range(1,n+1):
		r*=i
	return(r)

def ans(n,k,i):
	if(n-k < i-1):return(0)
	r1 = frac(k-1) // frac(k-i) // frac(i-1)
	r2 = frac(n-k+1) // frac(n-k-i+1) // frac(i)
	
	return(r1*r2)

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

for i in range(1,k+1):
	print(int(ans(n,k,i))%1000000007)
A, P = input().split()

print( (A*3+P) / 2)

### FIXED CODE ###

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

print(int((stdin[0]*3+stdin[1]) / 2))
N = int(input())
A = list(map(int,input().split()))
PI = 1
for i in range(N):
    PI = PI*A[i]
if PI > 10**(18):
    print(-1)
print(PI)

### FIXED CODE ###

N,K = map(int,input().split())
print(N*K)
n, k = [int(i) for i in input().split()]
al = [int(i) for i in input().split()]

index = 0
keiro = []

for i in range(k):
  index = al[index] - 1
  keiro.append(index)
  if keiro.count(index) == 2:
    start = keiro.index(index)
    mod = i - start
    break

print(keiro[k%mod-1]+1)

### FIXED CODE ###

n, k = [int(i) for i in input().split()]
al = [int(i) for i in input().split()]

index = 0
keiro = []
s_keiro = set()
loop_f = False

for i in range(k):
  index = al[index] - 1
  if index in s_keiro:
    start = keiro.index(index)
    mod = i - start
    loop_f = True
    break
  s_keiro.add(index)
  keiro.append(index)

if loop_f:
  pos = (k-start-1) % mod
  if mod == 1:
    print(keiro[start]+1)
  else:
    print(keiro[start + pos]+1)
else:
  print(keiro[-1] + 1)
import sys

def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())

n, m = ISI()
l=ILI()
if n-sum8(l)<:print(-1)
else:print(n-sum(l))

### FIXED CODE ###

import sys

def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())

n, m = ISI()
l=ILI()
if n-sum(l)<0:print(-1)
else:print(n-sum(l))
def step(n, A):
    if n == 1:
        return 1
    elif n == 2:
        return 2
    elif n in A:
        return 0
    else:
        return step(n-1, A) + step(n-2, A)

N, M = map(int, input().split())
A = [int(input()) for i in range(M)]
print(step(N, A))

### FIXED CODE ###

N, M = map(int, input().split())
A = [True] * (N+1)
for _ in range(M):
  idx = int(input())
  A[idx] = False

step = [0] * (N+1)
step[0] = 1
for i in range(1, N+1):
  if A[i]:
    step[i] = step[i-1] + step[i-2]
  else:
    step[i] = 0
print(step[N]%(10**9+7))
def kjou(kkk):
    ka=1
    for km in range(kkk):
        ka=ka*(km+1)    
    return ka

def fcof(ad):
    k=ad//2
    if k==0 :
        return 1
    kcnt=0
    for kk in range(k+1):
        ar=ad-(kk)*2
        dk=kjou(kk+ar)/kjou(kk)/kjou(ar)
        kcnt=kcnt+ dk
        print(ad,k,kk,ar)
    return kcnt       

n,m=map(int,input().split())
n=20
m=2
a1=int(input())
a1=3
icnt=1
for i in range(m):
    a2=int(input())
    a2=11
    ad=a2-a1-1
    if ad<=0:
        print(0)
    fcof1=fcof(ad) 
    icnt=icnt*fcof1
    a1=a2
    print(icnt)

### FIXED CODE ###

n,m=map(int,input().split())
a=set()
for i in range(m):
    ai=int(input())
    a.add(ai)


mod=10**9+7

t=[0]*(n+1)
t[0]=1

if 1 in a:
    t[1]=0
else:
    t[1]=1

for i in range(2,n+1):
    if i in a:
        t[i]=0
    else:
        t[i]=(t[i-1]+t[i-2])%mod

print(t[n])
import math
a,b,c,d = input().split()
a = int(a)
b= int(b)
c = int(c)
d = int(d)
s = b-a+1

cd = c*d // math.gcd(c,d)
a_ = ((a-1)//c + (a-1)//d) - ((a-1)//cd)
b_ = (b//c + b//d) - (b//cd)
s_ = b_- a_
print(s-s_)

### FIXED CODE ###

import fractions as fr
a,b,c,d = input().split()
a = int(a)
b= int(b)
c = int(c)
d = int(d)
s = b-a+1

cd = c*d // fr.gcd(c,d)
a_ = ((a-1)//c + (a-1)//d) - ((a-1)//cd)
b_ = (b//c + b//d) - (b//cd)
s_ = b_- a_
print(s-s_)
N,M=map(int,input().split())
S=[list(map(int,input().split())) for i in range(N)]
T=[list(map(int,input().split())) for i in range(M)]
for i in range(N):
    x1=S[i][0]
    y1=S[i][1]
    x2=T[0][0]
    y2=T[0][1]
    min=abs(x1-x2)+abs(y1-y2)
    x1=S[i][0]
    y1=S[i][1]
    for j in range(M-1,-1,-1):
        x2=T[j][0]
        y2=T[j][1]
        if min>=abs(x1-x2)+abs(y1-y2):
            min=abs(x1-x2)+abs(y1-y2)
            R[i]=j+1
for i in range(len(R)):
    print(R[i])

### FIXED CODE ###

N,M=map(int,input().split())
a=[list(map(int,input().split())) for i in range(N)]
b=[list(map(int,input().split())) for i in range(M)]
for i in range(N):
    dmin=abs(a[i][0]-b[0][0])+abs(a[i][1]-b[0][1])
    num=1
    for j in range(M):
        dist=abs(a[i][0]-b[j][0])+abs(a[i][1]-b[j][1])
        if dmin>dist:
            dmin=dist
            num=j+1
    print(num)
n,m = map(int,input().split())
MOD = 10**9 + 7

q = [1,2]
append = q.append
for i in range(10**5+10):
    if i >= 2:
        t = q[i-1]+q[i-2]
        t%= MOD
        append(t)
ans = 1
a_pre = 0
for i in range(m+1):
    if i == m:
        if a_now == n-1:
            print(0)
            exit()
        else:
            ans *= q[n-a_now-2]
            ans %=MOD
            break
    if i>0:
        a_pre = a_now
    a_now = int(input())
    if i == 0:
        if a_now != 1:
            ans*=q[a_now-2]
            ans%=MOD
    if i>0:
        if a_pre + 1 == a_now:
            print(0)
            exit()
        else:
            if a_now-a_pre-3!=-1:
                ans*=q[a_now-a_pre-3]
            ans %=MOD

print(ans)

### FIXED CODE ###

n,m = map(int,input().split())
MOD = 10**9 + 7
dp = [0 for i in range(n+1)]
t = [True for _ in range(n+1)]
for i in range(m):
    a = int(input())
    t[a] = False

dp[0] = 1
for now in range(n):
    for next in range(now+1,min(n+1,now+3)):
        if t[next]:
            dp[next] += dp[now]
            dp[next] %= MOD

print(dp[n])
s=input()
print(s[0]+(len(s)-2)+s[-1])

### FIXED CODE ###

s=input()
print(s[0]+str(len(s)-2)+s[-1])
a = input()
b = input()
c = input()
d = input()
print(min(int(a),int(b)) + min(int(c),int(d))

### FIXED CODE ###

a = input()
b = input()
c = input()
d = input()
print(min(int(a),int(b)) + min(int(c),int(d)))
n, m = map(int, input().split())

lac = [0] * n
lwa = [0] * n

for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if lac[p] == 0:
        if s == 'WA':
            lwa[p] += 1
        if s == 'AC':
            lac[p] = 1

print(sum(lac), sum(x * y for x, y in zip(lac, lwa)))

### FIXED CODE ###

print(chr(ord(input())+1))
import numpy as np
import time
import random
import collections
import bisect  

start = time.time()

def insert(list, n): 
    bisect.insort(list, n)  
    return list

def read_input():
  D = int(input())
  c = list(map(int, input().split()))
  s = [list(map(int, input().split())) for _ in range(D)]
  return D, c, s
D, c, s = read_input()

c = np.array(c)
s = np.array(s)
tests = np.argmax(s, axis=1)

def get_dates_for_tests(tests):
  dates_for_tests = [list([-1]) for _ in range(26)]
  for i, t in enumerate(tests):
    dates_for_tests[t].append(i)
  for t in range(26):
    dates_for_tests[t].append(D)
  return dates_for_tests

dates_for_tests = get_dates_for_tests(tests)

def get_score(tests):
  dates_for_tests = get_dates_for_tests(tests)
  score = 0
  d = np.zeros(26, dtype=np.int64)
  for selected, S in zip(tests, s):
    d += 1
    d[selected] = 0
    score += S[selected] - (c * d).sum()
  return score

def score_diff(date, test):
  #print(date, test)
  before = tests[date]
  if test == before:
    return 0, None, None
  pos_diff = s[date, test] - s[date, before]
  new_index = bisect.bisect_left(dates_for_tests[test], date, 1)
  new_diff = c[test] * (dates_for_tests[test][new_index] - date) * (date - dates_for_tests[test][new_index-1])

  old_index = bisect.bisect_left(dates_for_tests[before], date, 1)
  #print(c[test], dates_for_tests[test])
  #print(c[before], dates_for_tests[before])
  old_diff = c[before] * (dates_for_tests[before][old_index+1] - date) * (date - dates_for_tests[before][old_index-1])
  
  total_diff = pos_diff + new_diff - old_diff
  #print(test, total_diff, pos_diff, new_diff, -old_diff)
  return total_diff, new_index, old_index

# current_score = get_score(tests)
while time.time() < start + 1.8:
  t = time.time()
  for date in range(D):
    for test in range(26):
      # date = 4
      # test = 23

      total_diff, new_index, old_index= score_diff(date, test)
      to_update = total_diff > 0
      if t < start + 1.6 and total_diff > -5000:
        to_update += random.randrange(5) == 0
      if to_update:
        # print('INCREASING')
        #print(date, tests[date], test)
        #print(c[[tests[date], test]])
        #print(s[date, [tests[date], test]])
        del dates_for_tests[tests[date]][old_index]
        insert(dates_for_tests[test], date)
        tests[date] = test

        #assert dates_for_tests == get_dates_for_tests(tests)
        #new_score = get_score(tests)
        #print(total_diff, new_score - current_score , current_score, new_score) 
        #assert new_score == current_score + total_diff
        #current_score = new_score
        # raise ValueError
        
# print(get_score(tests))
for t in tests:
  print(t+1)


### FIXED CODE ###

import numpy as np
def read_input():
  D = int(input())
  c = list(map(int, input().split()))
  s = [list(map(int, input().split())) for _ in range(D)]
  return D, c, s
D, c, s = read_input()

for t in np.array(s).argmax(axis=1)+1:
  print(t)
import numpy as np
import math
import collections
import fractions
import itertools

def solve():
    n = int(input())
    h = list(map(int, input().split()))
    m = h[0]
    ans = 0
    for i in range(1,h-1):
        if h[i] >= m:
            ans += 1
            m = h[i]
    print(ans)
    return 0

if __name__ == '__main__':
    solve()

### FIXED CODE ###

import numpy as np
import math
import collections
import fractions
import itertools

def solve():
    n = int(input())
    h = list(map(int, input().split()))
    m = h[0]
    ans = 0
    for i in range(1,n):
        if h[i] >= m:
            ans += 1
            m = h[i]
    print(ans+1)
    return 0

if __name__ == '__main__':
    solve()
ans = [None] * 1000
for i in xrange(1000):
    ans[i] = [None] * 1000
for i in range(1000):
        ans[i][0] = 0
    for j in range(1000):
        ans[0][j] = 0
roop = input()
for k in range(roop):
    str1 = raw_input()
    str2 = raw_input()
    len1 = len(str1) + 1
    len2 = len(str2) + 1
    for i in range (1, len1):
        for j in range(1, len2):
            if(str1[i - 1] == str2[j - 1]):
                ans[i][j] = ans[i -1][j - 1] + 1
            else:
                ans[i][j] = max(ans[i - 1][j], ans[i][j - 1])
    print ans[len1 - 1][len2 - 1]

### FIXED CODE ###

def LCS():
    str1 = raw_input()
    str2 = raw_input()
    
    after = [0] * (len(str2) + 1)
    
    for i in xrange(1, len(str1) + 1):
        before = after + []
        for j in xrange(1, len(str2) + 1):
             if str1[i - 1] == str2[j - 1]:
                 after[j] = before[j - 1] + 1
             elif after[j - 1] > before[j]: #this is equal to 'max(after[j - 1], before[j])'
                 after[j] = after[j - 1]
    return after[j]

n = input()
for k in xrange(n):
    print LCS()
ああ

### FIXED CODE ###

a,b=map(int, input().split())
s=0
t=400000-100000*a
if t>0:
  s=t
u=400000-100000*b
if u>0:
  s+=u
if a+b==2:
  s+=400000
print(s)
N = int(input())
edges = [[] for _ in range(N)]
for _ in range(1, N):
    a, b, c = map(int, input().split())
    a, b = a - 1, b - 1
    edges[a].append([b, c])
    edges[b].append([a, c])

Q, K = map(int, input().split())
K -= 1
dist = [10**9 + 1] * N
dist[K] = 0


def dfs(s, before=-1):
    for edge in edges[s]:
        to = edge[0]
        c = edge[1]
        if to != before:
            dist[to] = dist[s] + c
            dfs(to, s)


dfs(K)
X = []
Y = []
for _ in range(Q):
    x, y = map(int, input().split())
    X.append(x-1)
    Y.append(y-1)

for i in range(Q):
    print(dist[X[i]] + dist[Y[i]])


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 7)

N = int(input())
edges = [[] for _ in range(N)]
for _ in range(1, N):
    a, b, c = map(int, input().split())
    a, b = a - 1, b - 1
    edges[a].append([b, c])
    edges[b].append([a, c])

Q, K = map(int, input().split())
K -= 1
dist = [pow(10, 9) + 1] * N
dist[K] = 0


def dfs(s, before=-1):
    for edge in edges[s]:
        to = edge[0]
        c = edge[1]
        if to != before:
            dist[to] = dist[s] + c
            dfs(to, s)


dfs(K)
for _ in range(Q):
    x, y = map(int, input().split())
    x, y = x-1, y-1
    print(dist[x] + dist[y])
N = int(input())
list = []
list = input().split()
M = 1
for i in range(1, N):
  k = list[i]
  t_list = [0:i+1]
  a_list = sorted(t_list, reverse=True)
  if a_list[0] == k:
    M += 1
    
print(M)

### FIXED CODE ###

N = int(input())
list = input().split()
ans = 0
maxHeight = -1
for i in range(N):
  if int(list[i]) >= maxHeight:
    ans += 1
    maxHeight = int(list[i])
print(ans)
n, d, a = map(int, input().split())
xh = []
for i in range(n):
    xh.append(list(map(int, input().split())))
xh.sort()
count = 0
min_x = 0
while sum([xh[i][1] for i in range(n)]):
    place = xh[min_x][0] + d
    num = (xh[min_x][1] - 1) // a + 1
    count += num
    check = min_x
    while xh[check][0] <= place + d:
        new_h = max(0, xh[check][1] - a * num)
        if new_h == 0:
            min_x += 1
        xh[check][1] = new_h
        check += 1
        if check == n:
            break
print(count)

### FIXED CODE ###

import bisect

n, d, a = map(int, input().split())
xh = []
for i in range(n):
    xh.append(list(map(int, input().split())))
xh.sort()
x = [xh[i][0] for i in range(n)]
h = [xh[i][1] for i in range(n)]
count = 0
min_x = 0
acm = [0] * (n + 1)
dif = [0] * (n + 1)
while min_x < n:
    place = x[min_x] + d
    num = (h[min_x] - acm[min_x + 1] - 1) // a + 1
    count += num
    dif[min_x] += num
    dif[bisect.bisect(x, place + d)] -= num
    for i in range(min_x, bisect.bisect(x, place + d)):
        acm[i + 1] = acm[i] + dif[i] * a
        if acm[i + 1] >= h[i]:
            min_x += 1
            continue
        else:
            break
print(count)
if n == 1:
  print(0)
else:
  print(n*(n-1)//2)

### FIXED CODE ###

n = int(input())
print(n*(n-1)//2)
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v = i*i+j*j+k*k+i*j+j*k+k*i;
    if v<10050:
      ans[v]+=1
for i in range(n):
print(ans[i+1])


### FIXED CODE ###

n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v = i*i+j*j+k*k+i*j+j*k+k*i;
      if v<10050:
        ans[v]+=1
for i in range(n):
  print(ans[i+1])
input(a)
if a == '0':
  print('1')
elif a == '1':
  print('0')

### FIXED CODE ###

a = input()
if a == '0':
  print('1')
elif a == '1':
  print('0')