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

def check(S, A, B):
    for i in range(N):
        for j in range(i+1, N):
            if S[i][j] != S[j][i]:
                return 0
    else return 1

cnt = 0
for i in range(N):
    cnt += check(S[i:] + S[:i], 0, i)
print(cnt * N)


### FIXED CODE ###

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

def check(S, A, B):
    for i in range(N):
        for j in range(i+1, N):
            if S[i][j] != S[j][i]:
                return 0
    return 1

cnt = 0
for i in range(N):
    cnt += check(S[i:] + S[:i], 0, 0)
print(cnt * N)
import itertools
import numpy as np

X = int(input())
maxs = int(X**(1/5))

l = np.arange(-maxs, maxs+1)

comb = np.array(list(itertools.combinations_with_replacement(l, 2)))

sum1 = comb[:, 0]**5 - comb[:, 1]**5
sum2 = comb[:, 1]**5 - comb[:, 0]**5

if len(np.where(sum1==X)[0]) != 0:
    result1 = np.where(sum1==X)[0][0]
    print(comb[result1][0], comb[result1][1])
else:
    result2 = np.where(sum2==X)[0][0]
    print(comb[result2][1], comb[result2][0])

### FIXED CODE ###

import itertools
import numpy as np

X = int(input())
maxs = int(X**(1/5))

l = np.arange(-126, 127)

comb = np.array(list(itertools.combinations_with_replacement(l, 2)))

sum1 = comb[:, 0]**5 - comb[:, 1]**5
sum2 = comb[:, 1]**5 - comb[:, 0]**5

if len(np.where(sum1==X)[0]) != 0:
    result1 = np.where(sum1==X)[0][0]
    print(comb[result1][0], comb[result1][1])
else:
    result2 = np.where(sum2==X)[0][0]
    print(comb[result2][1], comb[result2][0])
N, K = map(int,input().split())
A = sorted(map(int,input().split()))
start = A[0]
end = A[-1]
while start > end:
   l = (start + end)/2
   count = 0
   for i in range(N):
      count += A[i]//l + 1
   if count > K:
      start = l
   else:
      end = l
print(l)

### FIXED CODE ###

N, K = map(int,input().split())
A = list(map(int,input().split()))
start = 0
end = 10**9
while end - start > 1:
   l = (start + end)/2
   l = int(l)
   count = 0
   for i in range(N):
      q = A[i]/l
      if q == int(q):
         q -= 1
      count += int(q)
   if count <= K:
      end = l
   else:
      start = l
print(end)
import math 

def lcm(x,y):
    return (x * y) // math.gcd(x,y)

A,B,C,D = [int(i) for i in input().split(" ")]
AB = B-A
BC = AB//C
BD = AB//D
CD = lcm(C,D)
BCD = AB//CD
union = BC+BD-BCD
print(AB - union)
  

### FIXED CODE ###

import fractions
#解説見ました。
def lcm(x,y):
    return (x * y) // fractions.gcd(x,y)
def wei(n,x,y):
    return n-(n//x + n//y - n//lcm(x,y))

A,B,C,D = [int(i) for i in input().split(" ")]
print(wei(B,C,D) - wei(A-1,C,D))
n,k=map(float,input().split())
p=n*k
p=math.floor(p)
print(p)

### FIXED CODE ###

from fractions import Fraction
n,k=map(str,input().split())
a=int(n)
b=int(k[len(k)-2:])
c=int(k[:len(k)-3])
ans=a*c
t=Fraction(a*b,100)
ans+=int(t)
print(ans)
N = int(input())
K = int(input())
p = list(map(int, input().split()))
lists = []
  
for x,y,z in p:
  n = x + y + z
  return lists.append(n)

print(min(lists))
  
  

### FIXED CODE ###

S = list(map(int, input().strip().split()))
N = S[0]
K = S[1]
p = list(map(int, input().strip().split()))
lists = []
for l in range(K):
  lists.append(min(p))
  p.remove(min(p))
  
print(sum(lists))
M,N=map(int,input().split())
X = list(map(int,input().split()))
X.sort()
xdelta = []

for i in range(len(X)-1):
	xdelta.append(abs(X[i+1]-X[i]))

xdelta.sort()
#print(xdelta)

if M == 1:
	print(0)
elif N == 1:
	print(sum(xdelta))
elif M <= N:
	print(0)
else:
	for i in range(M-1):
		xdelta.pop(-1)
	print(sum(xdelta))

### FIXED CODE ###

N,M=map(int,input().split())
X = list(map(int,input().split()))
X.sort()
xdelta = []

for i in range(len(X)-1):
	xdelta.append(abs(X[i+1]-X[i]))

xdelta.sort()

if N < M:
	if N == 1:
		print(sum(xdelta))
	else:
		for i in range(N-1):
			xdelta.pop(-1)
		print(sum(xdelta))
else:
	print(0)
from functools import lru_cache

import sys
sys.setrecursionlimit(10**9)

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

M = 10 ** 9 + 7

@lru_cache(maxsize=10*9)
def combinations(n, r):
    if n == 0 or r == 0: return 1
    return int(combinations(n, r-1) * (n-r+1) / r)

def f(i):
    return (combinations(N - K + 1, i) % M) * (combinations(K - 1, i - 1) % M)

for i in range(1, K + 1):
    print(f(i) % M)


### FIXED CODE ###

from functools import lru_cache

import sys
sys.setrecursionlimit(10**9)

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

M = 10 ** 9 + 7

@lru_cache(maxsize=10**9)
def combinations(n, r):
    if n == 0 or r == 0: return 1
    return int((combinations(n, r-1) * (n-r+1)) // r)

def f(i):
    return (combinations(N - K + 1, i) % M) * (combinations(K - 1, i - 1) % M)

for i in range(1, K + 1):
    print(f(i) % M)
a,b = map(int,input().split())
print map(int,a*b,(a*b)*2.split)

### FIXED CODE ###

foo,bar = map(int,raw_input().split())
print '%d %d' % (foo*bar,(foo+bar)*2)
G,R= map(int, input().split())
print(2*G-R)

### FIXED CODE ###

R = int(input())
G = int(input())
print(2*G-R)
n = int(input())
s, t = map(int, input().split())

answer_list = []
for i in range(n):
  answer_list.append(s[i])
  answer_list.append(t[i])
  
print(answer_list.join())

### FIXED CODE ###

n = int(input())
s, t = input().split()
 
answer_list = []
for i in range(n):
  answer_list.append(s[i])
  answer_list.append(t[i])

joint = ''.join(answer_list)
print(joint)
print(*['']+[i for i in range(3,int(input())+1)if i%3==0 or '3' in str(i)])

### FIXED CODE ###

print('',*[i for i in range(3,int(input())+1)if i%3==0 or'3'in str(i)])
A = input()
B = input()
C = B[:len(B)-2]
if A == C:
  D = "Yes"
  else:
    D = "No"
print(D)

### FIXED CODE ###

A = input()
B = input()
C = B[:len(B)-1]
if A == C:
  D = "Yes"
else:
  D = "No"
print(D)
import math
import sympy as sym
a,b,c = map(int,input().split())

if math.sqrt(sym.Float(a)) + math.sqrt(sym.Float(b)) < math.sqrt(sym.Float(c)):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

from decimal import *
getcontext().prec = 50
a,b,c = map(int,input().split())

if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print("Yes")
else:
    print("No")
sd = input()
t = input()
n = len(sd)
m = len(t)
ss = []
for i in range(n - m + 1):
    flag = True
    s = ""
    for j in range(m):
        if sd[i + j] == "?" or sd[i + j] == t[j]:
            continue
        else:
            flag = False
    if flag:
        k = 0
        for j in range(n):
            if j < i or j > i + m:
                if sd[j] == "?":
                    s += "a"
                else:
                    s += sd[j]
            else:
                if sd[j] == "?":
                    s += t[k]
                else:
                    s += sd[j]
                k += 1
        ss.append(s)
if ss:
    print(sorted(ss)[0])
else:
    print("UNRESTORABLE")

### FIXED CODE ###

sd = input()
t = input()
for i in range(len(sd) - len(t), -1, -1):
    t_kamo = sd[i:i + len(t)]
    for j in range(len(t) + 1):
        if j == len(t):
            s = sd[:i].replace("?", "a") + t + sd[i + len(t):].replace("?", "a")
            print(s)
            exit()
        if t_kamo[j] == "?":
            continue
        elif t_kamo[j] != t[j]:
            break
print("UNRESTORABLE")
A = list(map(int, input().split()))
B=[]
C=[]
for i in range(N):
    B.append(A[i]-1)
for i in range(N):
    C.append(A[i]+1)
D=[]
D=A+B+C

mx=0
for i in D:
    cnt=0
    for j in range(N):
        if i==A[j]:
            cnt+=1
        elif i==B[j]:
            cnt+=1
        elif i==C[j]:
            cnt+=1
    mx=max(mx,cnt)
print(mx)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B=[]
C=[]
for i in range(N):
    B.append(A[i]-1)
for i in range(N):
    C.append(A[i]+1)
D=[]
D=A+B+C
mx=0
E=[0]*10**6
for i in D:
    E[i]+=1
    
print(max(E))
S = list(set(list(input())))
S.sort()
al = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(al)):
  if al[i] != S[i]:
    ans = al[i]
    break
if len(S)==26:
  ans = 'None'
print(ans)

### FIXED CODE ###

S = list(set(list(input())))
S.sort()
al = 'abcdefghijklmnopqrstuvwxyz'
if len(S)==26:
  ans = 'None'
else:
  for i in range(len(S)):
    if al[i] != S[i]:
      ans = al[i]
      break
    else:
      ans = al[len(S)]
print(ans)
# -*- coding: utf-8 -*-

K=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

a = input()

num = a-1
print(K[num])

### FIXED CODE ###

# -*- coding: utf-8 -*-

K=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

a = int(input())

num = a-1
print(K[num])
c=[x+' '+y for x in'SHCD'for y in range(1,14)
for _ in range(int(input())):c.remove(input())
print('\n'.join(c))

### FIXED CODE ###

n=int(input())
e=[input()for _ in[0]*n]
for s in"SHCD":
 for r in range(1,14):
  if f'{s} {r}'not in e:print(s,r)
K=list(map, int(input()))
a=int(input())
print(K.index(a))


### FIXED CODE ###

K=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
a=int(input())
print(K[a-1])
input = input()
hour = int(input) / 3600
minute = hour / 60
second = minute / 60
print("%1:%2:%3") % (hour,minute,second)

### FIXED CODE ###

input = int(input())
if 0 <= input < 86400:
    hour = input / 3600
    minute = (input / 60) % 60
    second = input % 60
    print("%d:%d:%d" % (hour,minute,second))
s = input()
dp = [0 for _ in range(0,4)]
dp[3] = 1
dp[0] = 0
dp[1] = 0
dp[2] = 0
abc = "ABC".index
mod = 10**9 + 7
for i in range(len(s)-1,-1,-1):
    if s[i] == "?":
        dp = [
        (dp[0]*3+ dp[1])%mod
        ,(dp[1]*3+ dp[2])%mod
        ,(dp[2]*3 + dp[3])%mod
        ,(dp[3]*3)%mod
        ]
    else:
        num = abc(s[i])
        dp[i][num] += dp[i+1][num+1] % mod
# for i in range(len(s),-1,-1):
#     print(dp[i])
print(dp[0][0] %mod)


### FIXED CODE ###

s = input()
dp = [0 for _ in range(0,4)]
dp[3] = 1
dp[0] = 0
dp[1] = 0
dp[2] = 0
abc = "ABC".index
mod = 10**9 + 7
for i in range(len(s)-1,-1,-1):
    if s[i] == "?":
        dp = [
        (dp[0]*3+ dp[1])%mod
        ,(dp[1]*3+ dp[2])%mod
        ,(dp[2]*3 + dp[3])%mod
        ,(dp[3]*3)%mod
        ]
    else:
        num = abc(s[i])
        dp[num] += dp[num+1] % mod
print(dp[0] %mod)
import sys

s = input()
t = input()

tl = len(t) ; sl = len(s)

for i in range(sl,tl-1,-1) :
  st = s[i-tl:i]
  c = 0
  for j in range(tl) :
    if st[j] == '?' :
      continue
    elif st[j] != '?' and st[j] == t[j] :
      continue
    c = 1
    break
  if c == 0 :
    s = s[:i-tl] + t + s[i:]
    break

if c == 1 :
  print('UNRESTORABLE')
else : 
  print(s.replace('?', 'a'))

### FIXED CODE ###

import sys

s = input()
t = input()

tl = len(t) ; sl = len(s)

c = 1
for i in range(sl,tl-1,-1) :
  st = s[i-tl:i]
  c = 0
  for j in range(tl) :
    if st[j] == '?' :
      continue
    elif st[j] != '?' and st[j] == t[j] :
      continue
    c = 1
    break
  if c == 0 :
    s = s[:i-tl] + t + s[i:]
    break

if c == 1 :
  print('UNRESTORABLE')
else : 
  print(s.replace('?', 'a'))
a,b,c=map(int,input().split())
K=int(input())
if a<b:
    if b<c:
        flag=0
    else:
        if b<c*(2**K):
            flag=0
        else:
            flag=1
else:
    while a>=b:
        if K>0:
            b=b*2
            K-=1
        else:
            flag=1
            break
    if K>0:
        if b<c:
            flag=1
        else:
            if b<c*(2**K):
                flag=0
            else:
                flag=1
if flag==0:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

a,b,c=map(int,input().split())
K=int(input())
flag=0
if a>=b:
    while a>=b:
        if K>0:
            b=b*2
            K-=1
        else:
            flag=1
            break
if b>=c and flag==0:
    while b>=c:
        if K>0:
            c=c*2
            K-=1
        else:
            flag=1
            break
            
if flag==0:
    print("Yes")
else:
    print("No")
import sys

stack = []

array = sys,stdin.readline().strip().split(" ")

for op in array:
    if op.isdigit():
        stack.append(int(op))
    else:
        tmp1 = stack.pop()
        tmp2 = stack.pop()
        if op == "+":
            stack.append(tmp1 + tmp2)
        elif op == "-":
            stack.append(tmp2 - tmp1)
        elif op == "*":
            stack.append(tmp1 * tmp2)
        elif op == "/":
            stack.append(float(tmp2) / tmp1)
res = stack.pop()
print str(int(res))

### FIXED CODE ###

import sys

stack = []

array = sys.stdin.readline().strip().split(" ")

for op in array:
    if op.isdigit():
        stack.append(int(op))
    else:
        tmp1 = stack.pop()
        tmp2 = stack.pop()
        if op == "+":
            stack.append(tmp1 + tmp2)
        elif op == "-":
            stack.append(tmp2 - tmp1)
        elif op == "*":
            stack.append(tmp1 * tmp2)
        elif op == "/":
            stack.append(float(tmp2) / tmp1)
res = stack.pop()
print str(int(res))
def int_raw():
    return int(raw_input())

def ss_raw():
    return raw_input().split()

def ints_raw():
    return map(int,ss_raw())

INF = 1<<29

DIV = 10**9+7

def make2d_arr(w,h,val =INF):
    return [[val]*w for i in xrange(h)]

def floyd_warshall(costs):
    N = len(costs)
    for k in xrange(N):
        for i in xrange(N):
            for j in xrange(N):
                costs[i][j]  = min(costs[i][j],costs[i][k]+costs[k][j])
    return costs

N = int_raw()
C =[]
dp = [0 for i in xrange(N)]

m_prev = {}
prevs = [-1 for i in xrange(N)]

for i in xrange(N):
    c = int_raw()
    C.append(c)
    if c in m_prev:
        prevs[i] = m_prev[c]
        m_prev[c]= i
    else:
        m_prev[c]=i
    
dp[0] =1
dp[1] =1

for x in xrange(2,N):
    cx = C[x]
    dp[x] = dp[x-1]
    if cx == C[x-1]:
        continue
    y = prevs[x]
    if y != -1:
        dp[x]+=dp[y]
        dp[x]= dp[x]%DIV        
    """for y in xrange(x-2,-1,-1):
        cy = C[y]
        if cx == cy:
            dp[x]+=dp[y]
            dp[x]= dp[x]%DIV
            break"""

print dp[-1] 





### FIXED CODE ###

def int_raw():
    return int(raw_input())

def ss_raw():
    return raw_input().split()

def ints_raw():
    return map(int,ss_raw())

INF = 1<<29

DIV = 10**9+7

def make2d_arr(w,h,val =INF):
    return [[val]*w for i in xrange(h)]

def floyd_warshall(costs):
    N = len(costs)
    for k in xrange(N):
        for i in xrange(N):
            for j in xrange(N):
                costs[i][j]  = min(costs[i][j],costs[i][k]+costs[k][j])
    return costs

N = int_raw()
C =[]
dp = [0 for i in xrange(N)]

m_prev = {}
prevs = [-1 for i in xrange(N)]

for i in xrange(N):
    c = int_raw()
    C.append(c)
    if c in m_prev:
        prevs[i] = m_prev[c]
        m_prev[c]= i
    else:
        m_prev[c]=i
    
dp[0] =1

for x in xrange(1,N):
    cx = C[x]
    dp[x] = dp[x-1]
    if cx == C[x-1]:
        continue
    y = prevs[x]
    if y != -1:
        dp[x]+=dp[y]
        dp[x]= dp[x]%DIV        
    """for y in xrange(x-2,-1,-1):
        cy = C[y]
        if cx == cy:
            dp[x]+=dp[y]
            dp[x]= dp[x]%DIV
            break"""

print dp[-1]
mod = 1000000007
dp=[]
def countways(n,broken,index):
	global dp
	if(dp[index]!=-1):
		return dp[index]

	ways = 0
	if(index+1<=n and broken[index+1]==0):
		ways+=countways(n,broken,index+1)
	if(index+2<=n and broken[index+2]==0):
		ways+=countways(n,broken,index+2)
	dp[index]=(ways%mod)
	return dp[index]

n,m = list(map(int,input().split()))
dp = [-1 for i in range(n+1)]
dp[n] = 1
broken = [0 for i in range(n+1)]
for i in range(m):
	broken[int(input())]=1
print(countways(n,broken,0)%mod)

### FIXED CODE ###

md = 1000000007
n,m = list(map(int,input().split()))
broken = [0 for i in range(n+1)]
dp=[0 for i in range(n+1)]
dp[0] = 1
for i in range(m):
	broken[int(input())]=1
# print(brok	en)
for j in range(1,n+1):
	if(broken[n-j]==1):
		continue
	if(j==1):
		dp[j]=1
	else:
		dp[j]=(dp[j-1]+dp[j-2])%md
# print(dp)
print(dp[n]%md)
#!/usr/bin/env python3
import sys
import numpy as np

def solve(N: int, M: int, edges, S: int, T: int):
    S -= 1
    T -= 1
    now = np.zeros(N)
    now[0] = 1
    seen = now > 0
    c = 0
    s = 0
    while s < np.count_nonzero(seen):
        c += 1
        s = np.count_nonzero(seen)
        now = now.dot(edges)
        if now[T]:
            print(c)
            exit()
        seen |= now > 0
    print(-1)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    Mat = np.zeros((N, N))
    for _ in range(M):
        u, v = int(next(tokens)) - 1, int(next(tokens))-1
        Mat[u][v] = 1
        #Mat[v][u] = 1


    Three = np.copy(Mat)
    for _ in range(2):
        Three = Three.dot(Mat)

    #print(Three)

    S = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    solve(N, M, Three, S, T)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
from collections import deque

def solve(N: int, M: int, G, S: int, T: int):
    S -= 1
    T -= 1
    now = deque([S])
    dist = [0 for _ in range(N * 3)]
    while now:
        p = now.popleft()
        for n in G[p]:
            if dist[n] != 0:
                continue
            dist[n] = dist[p] + 1
            if n == T:
                print(dist[n] // 3)
                exit()
            now.append(n)
    print(-1)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    G = tuple(set() for _ in range(N * 3))
    for _ in range(M):
        u, v = int(next(tokens)) - 1, int(next(tokens))-1
        G[u].add(v + N)
        G[u + N].add(v + 2 * N)
        G[u + 2 * N].add(v)

    S = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    solve(N, M, G, S, T)

if __name__ == '__main__':
    main()
N=input()
S=list(input())
 
if N%2!=0:
    print('No')
else:
    if S[:N/2]==S[N/2:]:
        print('Yes')
    else:
        print('No')



### FIXED CODE ###

N=int(input())
S=list(input())
 
if N%2!=0:
    print('No')
else:
    if S[:N//2]==S[N//2:]:
        print('Yes')
    else:
        print('No')
import sys
import os
f = open('input.txt', 'r')
sys.stdin = f

s = list(map(int, input().split()))
ans = 0

if s[0]<=10:
    ans = s[1]+100*(10-s[0])
else:
    ans = s[1]

print(ans)


### FIXED CODE ###

s = list(map(int, input().split()))
ans = 0

if s[0]<=10:
    ans = s[1]+100*(10-s[0])
else:
    ans = s[1]

print(ans)
import sys
import math
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def gcd_multi(nums):
    if len(nums) == 0:
        return 0
    if len(nums) <= 2:
        return min(nums)

    ret = math.gcd(nums.pop(), nums.pop())
    while len(nums) > 0:
        ret = math.gcd(ret, nums.pop())
    return ret


def solve(inputs):
    monsters = string_to_int(inputs[0])
    return gcd_multi(monsters)


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    input()
    ret = solve(inputs(1))
    print(ret)


### FIXED CODE ###

import sys
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def gcd(a, b):
    if a == 0:
        return b
    if b == 0:
        return a

    if a > b:
        return gcd(b, a % b)
    else:
        return gcd(a, b % a)


def gcd_multi(nums):
    if len(nums) == 0:
        return 0
    if len(nums) == 1:
        return nums[0]

    ret = gcd(nums.pop(), nums.pop())
    while len(nums) > 0:
        ret = gcd(ret, nums.pop())
    return ret


def solve(inputs):
    monsters = string_to_int(inputs[0])
    return gcd_multi(monsters)


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    input()
    ret = solve(inputs(1))
    print(ret)
#a,b,c,d=map(int,input().split())
n=int(input())
s=input()
ans=0
for i in s:
  if i=="I":
    ans+=1
  elif i=="D":
    ans-=1
  
if x<0:
  print(0)
else:
  print(ans)

### FIXED CODE ###

#a,b,c,d=map(int,input().split())
n=int(input())
s=input()
ans=0
hantei=0
for i in s:
  if i=="I":
    ans+=1
  elif i=="D":
    ans-=1
  if ans>hantei:
    hantei=ans
  
print(hantei)
N, K, Q = map(int, input().split())
list_winner = []
list_point =[]

for _ in range(Q):
    A = int(input())
    list_winner.append(A)
    list_point.append(K)
    
def add(n):
    return n-Q
    
list_point_new = []

for i in list_point:
    list_point_new.append(add(i))
    
for i in range(Q):
    a = list_winner[i]-1
    list_point_new[a] = list_point_new[a] + 1
    
for i in range(Q):
    if list_point_new[i] <= 0:
        print('No')
    else:
        print('Yes')

### FIXED CODE ###

N, K, Q = map(int, input().split())
list_winner = []
list_point =[]

for _ in range(Q):
    A = int(input())
    list_winner.append(A)

for i in range(N):
    list_point.append(K)
    
    
def add(n):
    return n-Q
    
list_point_new = []

for i in list_point:
    list_point_new.append(add(i))
    
for i in range(Q):
    a = list_winner[i]-1
    list_point_new[a] = list_point_new[a] + 1
    
for i in range(N):
    if list_point_new[i] <= 0:
        print('No')
    else:
        print('Yes')
N = int(input())
A = input()
list_A = A.split()
set_A = set(list_A)
 i = 0
for a in list_A:
  if a in set_A:
    i += 1
  i = i - len(set_A)
  if i % 2 == 0:
    print(N - i)
  else:
    print(N - (i +1))

### FIXED CODE ###

N = int(input())
A = input()
list_A = A.split()
set_A = set(list_A)
i = 0

for a in list_A:
    if a in set_A:
        i += 1
        
i = i - len(set_A)
if i % 2 == 0:
    print(N - i)
else:
    print(N - (i +1))
N = int(input())
multiple_4 = [x*4 for x in range(101) if x >= 1 and x <= 25]
multiple_7 = [x*7 for x in range(101) if x >= 1 and x <= 14]
multiple_4_7 = [x*4+7 for x in range(101) if x >= 1 and x <= 23]
multiple_7_4 = [x*7+4 for x in range(101) if x >= 1 and x <= 23]
tmp = []
for i in range(10):
  for j in range(10):
    solve = (4*(i+1))+(7*(j+1))
    if solve <= 100:
      tmp.append(solve)
multiple_other = sorted(list(set(tmp)))
  if N in multiple_4 or N in multiple_7 or N in multiple_4_7 or N in multiple_7_4 or N in multiple_other:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

N = int(input())
multiple_4 = [x*4 for x in range(101) if x >= 1 and x <= 25]
multiple_7 = [x*7 for x in range(101) if x >= 1 and x <= 14]
multiple_4_7 = [x*4+7 for x in range(101) if x >= 1 and x <= 23]
multiple_7_4 = [x*7+4 for x in range(101) if x >= 1 and x <= 23]
tmp = []
for i in range(10):
  for j in range(10):
    solve = (4*(i+1))+(7*(j+1))
    if solve <= 100:
      tmp.append(solve)
multiple_other = sorted(list(set(tmp)))
if N in multiple_4 or N in multiple_7 or N in multiple_4_7 or N in multiple_7_4 or N in multiple_other:
  print("Yes")
else:
  print("No")