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

import sys
def input(): return sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**6)
# ----------------------------------------------------------- #

n = int(input())
A = list(int(x) for x in input().split())
A.sort()
ans = 0
while A:
    tmp = A[0]
    if len(A) > 1:
        if tmp not in A[1:]:
            ans += 1
        A = [a for a in A[1:] if a % tmp != 0]
    else:
        ans += 1
        break
print(ans)


### FIXED CODE ###

import sys
from collections import Counter
def input(): return sys.stdin.readline().rstrip()
# ----------------------------------------------------------- #

n = int(input())
A = list(int(x) for x in input().split())
A.sort()
counter = Counter(A)
ans = 0
cache = set()
for a in A:
    if a in cache:
        continue
    tmp = a
    while tmp <= 10**6:
        cache.add(tmp)
        tmp += a
    if counter[a] == 1:
        ans += 1
print(ans)
### BUGGY CODE ###

n = int(input())
s = []
for _ in range(n):
    s.append(input())

def plusb(s,b):
    global n
    ns = []
    for i in range(n-b):
        ns.append(s[b+i])
    for i in range(b):
        ns.append(s[i])
    return ns

def val(s):
    global n
    for i in range(n):
        for j in range(n):
            if s[i][j] != s[j][i]:
                return False
    return True

res = 0
for k in range(0,n):
    if val(plusb(s,k)):
        res += n
print(res)

### FIXED CODE ###

n = int(input())
s = []
for _ in range(n):
    s.append(input())
st=list(map(''.join,zip(*s)))

def plusa(s,a):
    ns = []
    for ss in s:
        ns.append(ss[a:]+ss[:a])
    return ns

def plusb(s,b):
    global n
    ns = []
    for i in range(n-b):
        ns.append(s[b+i])
    for i in range(b):
        ns.append(s[i])
    return ns

res = 0
for i in range(n):
    if plusa(st,i) == plusb(s,i):
        res += n

print(res)
### BUGGY CODE ###

A,B,C,K = map(int,input().split())
result = 0
#A分引く
if (K - A) < 0:
    for i in range(A):
        if K <= 0:
            break
        result = result + 1
        K  -= 1
else:
    K -= A
    result += 1*A

if (K-B) < 0:
    for i in range(B):
        if K <= 0:
            break
        K -= 1
else:
    K -= B

if (K-C) < 0:
    for i in range(C):
        if K <= 0:
            break
        K -= 1
        result -= 1
else:
    K -= C
    result -= C
print(result)
    


### FIXED CODE ###

A,B,C,K = map(int,input().split())

def abc(A,B,C,K):
    result = 0
    #A分引く
    K = K - A
    result = A + result
    if K < 0:
        K = K + A
        result -= abs(abs(K)-A)
        return result
    K -= B
    if K < 0:
        return result
    K -= C
    result -= C
    if K < 0:
        K += C
        result += abs(abs(K)-C)
    return result
print(abc(A,B,C,K))
### BUGGY CODE ###

import math

N = int(input())

A = list(map(int, input().split()))
heikin = round(sum(A) / N) - 1

for i in range(N):
    A[i] = A[i] - heikin - i

s = []
t = []

absmax = max(list(map(abs, A)))
t = [A[i] - absmax - 1 for i in range(N)]

for i in range(-absmax - 1  , absmax + 1):
    t = [t[j] + 1 for j in range(N)]
    s.append(sum(list(map(abs, t))))

print(min(s))

### FIXED CODE ###

import statistics
import math

N = int(input())

A = list(map(int, input().split()))
A = [A[i] - i for i in range(N)]
med = round(statistics.median(A))

s0 = sum([abs(A[i] - med) for i in range(N)])
s1 = sum([abs(A[i] - med -1) for i in range(N)])
s2 = sum([abs(A[i] - med + 1) for i in range(N)])

print(min(s0, s1, s2))
### BUGGY CODE ###

import math
from functools import reduce

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

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

K = int(input())

a = 1
b = 1
c= 1
ans = 0

while a <= K:
  b = 1
  while b <= K:
    c = 1
    while c <=K:
      ans += gcd(a, b, c)
      c += 1
    b += 1
  a += 1

print(ans)

### FIXED CODE ###

import math
from functools import reduce

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

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

K = int(input())

a = 1
b = 1
c= 1
ans = 0

while a <= K:
  b = 1
  while b <= K:
    c = 1
    while c <=K:
      if gcd(a, b) == 1:
        ans += 1
      else:
        ans += gcd(a, b, c)
      c += 1
    b += 1
  a += 1
print(ans)
### BUGGY CODE ###

n,q = map(int,input().split())
s = input()
l = [list(map(int,input().split())) for i in range(q)]
#print(n,q,s,l)

acl = []
acr = []
for i in range(n-1):
    if s[i] == "A" and s[i+1] == "C":
        acl.append(i)
        acr.append(i+1)
#print(ac)
m = len(acl)
for i in range(q):
    ans = 0
    left = l[i][0] - 1
    right = l[i][1] - 1
    for a in acl:
        if left <= a and a < right:
            ans += 1
    print(ans)   

### FIXED CODE ###

n,q = map(int,input().split())
s = input()
l = [list(map(int,input().split())) for i in range(q)]
#print(n,q,s,l)

ac = []
for i in range(n-1):
    if s[i] == "A" and s[i+1] == "C":
        ac.append(i)
#print(ac)
cum = [0]*n
for i in range(1,n):
    if s[i-1] == "A" and s[i] == "C":
        cum[i] = cum[i-1] + 1
    else:
        cum[i] = cum[i-1]
#print(cum)
ans = 0 
for i in range(q):
    left = l[i][0]-1
    right = l[i][1]-1
    ans = cum[right] - cum[left]
    print(ans)
### BUGGY CODE ###

N, X, Y = map(int, input().split())
List = []
for i in range(1,N):
  for j in range(i+1, N+1):
    List.append(min(j-i, abs(X-i)+1+abs(j-Y), abs(Y-i)+1+abs(j-X)))
for k in range(1, N):
  print(List.count(k))

### FIXED CODE ###

N, X, Y = map(int, input().split())
List = [0 for _ in range(N-1)]
for i in range(1,N):
  for j in range(i+1, N+1):
    num = min(j-i, abs(X-i)+1+abs(j-Y), abs(Y-i)+1+abs(j-X))
    List[num-1] += 1
for k in range(N-1):
  print(List[k])
### BUGGY CODE ###

import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def adj(n): return [[] for _ in range(n)]

n = iinput()
a = iarr()
amax = 10**6

cnt = [0 for i in range(amax+1)]
for num in a:
    for i in range(1,amax//num + 1):
        tmp = num * i
        cnt[tmp] += 1

ans = 0
for num in a:
    if cnt[num]==1: ans += 1
print(ans)



### FIXED CODE ###

import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def adj(n): return [[] for _ in range(n)]

n = iinput()
a = iarr()
amax = max(a)
#amax = 10**6

cnt = [0 for i in range(amax+1)]
for num in a:
    for i in range(1,amax//num + 1):
        tmp = num * i
        cnt[tmp] += 1

ans = 0
for num in a:
    if cnt[num]==1: ans += 1
print(ans)
### BUGGY CODE ###

nk = input('')
n = int(nk.split()[0])
k = int(nk.split()[1])

alist = list(map(int,input('').split()))

pre=0
for i in range(n-k+1):
    result=1
    record=""
    for j in range(k):
        result *= alist[j+i]
        record += " " + str(alist[j+i])
#    print("[{}/{}]:{} = {}".format(i,i+k-1,result,record))
    if i>0:
        if result > pre:
            print('Yes')
        else:
            print('No')
    pre=result


### FIXED CODE ###

nk = input('')
n = int(nk.split()[0])
k = int(nk.split()[1])

alist = list(map(int,input('').split()))

for i in range(1,n-k+1):
    removed = alist[i-1]
    inserted = alist[i+k-1]
    if inserted > removed:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

N = int(input())

for i in range(1,N+1):
  ans = 0
  if i < 6:
    print(ans)
  else:
    for a in range(2,int((2*i)**0.5+1)):
      for b in range(a,int((2*i-a**2)**0.5+1)):
        for c in range(b,int((2*i-a**2-b**2)**0.5+1)):
          #print(a,b,c)
          if a**2 + b**2 + c**2 == 2*i:
            if max(a,b,c) < a+b+c-max(a,b,c):
              if len({a,b,c}) == 1:
                ans = 1
              elif len({a,b,c}) == 2:
                ans = 3
              else:
                ans = 6
              #print(a,b,c)
    print(ans)



### FIXED CODE ###

import numpy as np

N = int(input())

#print(1e+5)
ans = np.zeros(int(1e+5),dtype = int)
for x in range(1,int(N**0.5+1)):
  for y in range(x,int((N-x**2)**0.5+1)):
    for z in range(y,int((N-x**2-y**2)**0.5+1)):
      n = x**2 + y**2 + z**2 +x*y+y*z+z*x
      num = len({x,y,z})
      if num == 1:
        ans[n] += 1
      elif num == 2:
        ans[n] += 3
      elif num == 3:
        ans[n] += 6

for i in range(1,N+1):
  print(ans[i])
### BUGGY CODE ###

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

# output
for i in range(N):
  tmp = A.copy();
  tmp.remove(A[i]);
  print(max(tmp))

### FIXED CODE ###

N = int(input())
A = [int(input()) for i in range(N)]

tmp = A.copy();
tmp.sort()
max1_A = tmp[-1];
max2_A = tmp[-2];
max_count = A.count(max1_A);

# 最大値が複数ある場合
if max_count > 1:
  for i in range(N):
    print(max1_A)
# 最大値が1つある場合
else:
  for i in range(N):
    if A[i] < max1_A:
      print(max1_A)
    else:
      print(max2_A)
      break
  for j in range(i+1,N):
    print(max1_A)
### BUGGY CODE ###

n = input()
a = map(int, raw_input().split())

s = 1
count = 0

for i in xrange(0,n):
	if a[i]%2 == 0:
		s *= a[i]
		s = s >> 1
		count += 1

while(s%2 == 0):
	s = s >> 1
	count += 1

print count


### FIXED CODE ###

n = input()
a = map(int, raw_input().split())

l = []
s = 1
count = 0

while(len(a) != 0):

# for j in xrange(0,5):
	for i in xrange(0,len(a)):
		if a[i]%2 == 0 and a[i] != 0:
			l.append(a[i] >> 1)

	count += len(l)
	a = []
	a.extend(l)
	l = []

print count
### BUGGY CODE ###

R, B, G,N = map(int,input().split())


cnt = 0
ball = 0
a = sorted([R,G,B])
for r in range(N//a[0]+1):
    ball = r*a[0]
    for b in range((N-ball)//a[1]+1):
        if N-ball >= 0 and (N-ball-b*a[1])%a[2] == 0:
            cnt += 1

print(cnt)

### FIXED CODE ###

R, B, G, N = map(int,input().split())
 
 
cnt = 0
ball = 0
a = sorted([R,G,B])
for r in range(N//a[0]+1):
    ball = r*a[0]
    for b in range((N-ball)//a[1]+1):
        if N-ball >= 0 and (N-ball-b*a[1])%a[2] == 0:
            cnt += 1
 
print(cnt)
### BUGGY CODE ###

from itertools import combinations

n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
products = []
for i in combinations(a, 2):
    products.append(i[0] * i[1])
print(sorted(products)[k - 1])


### FIXED CODE ###

import numpy as np

n, k = [int(i) for i in input().split()]
a = np.array(sorted([int(i) for i in input().split()]))
posi = a[a > 0]
zero = a[a == 0]
nega = a[a < 0]

# 2分探索, mid より小さいものを数える
l = -10 ** 18 - 1
r = 10 ** 18 + 1
while r - l > 1:
    mid = (r + l) // 2
    cnt = 0
    if mid >= 0:
        cnt += len(zero) * n

    cnt += a.searchsorted(mid // posi, side="right").sum()
    cnt += (n - a.searchsorted(-(-mid // nega), side="left")).sum()
    cnt -= np.count_nonzero(a * a <= mid)
    cnt //= 2
    if cnt >= k:
        r = mid
    else:
        l = mid
print(r)
### BUGGY CODE ###

k, s = input().split(" ")
count = 0

for x in range(int(k)+1):
  for y in range(int(k)+1):
    z = int(s) - x -y
    if z >= 0 and z <= int(k):
      count += 1

print(count)

### FIXED CODE ###

k, s = map(int, input().split())
count = 0

for x in range(k+1):
  for y in range(k+1):
    z = s - x -y
    if z >= 0 and z <= k:
      count += 1

print(count)
### BUGGY CODE ###

import sys
import math
import itertools
# num = []
# for e in sys.stdin:
#     num.append(map(int, e.split()))

N = int(input())

for n in range(1, N+1):
    count = 0;
    max = min(int(math.sqrt(n)), int(n/2))
    l = []

    for i in range(1, max+1):
        l.append(i)

    h = itertools.combinations_with_replacement(l, 3)

    for i,j,k in h:
        if n == (i+j+k)**2 - i*j - j*k - k*i:
            if(i==j==k):
                count+=1
            elif(i==j or j==k or i == k):
                count+=3
            else:
                count+=6

    # for i in range(1, max+1):
    #     for j in range(1, max+1):
    #         for k in range(1, max+1):
    #             num = i**2 + j**2 + k**2 + i*j + j*k + k*i
    #             if n == num:
    #                 count+=1
    print(count)


    # print(max)


    # l = []
    #
    # for i in range(1, max+1):
    #     l.append(i)
    #
    # # h = itertools.combinations_with_replacement(l, 3)
    #
    # for i,j,k in h:
    #     if n == i**2 + j**2 + k**2 + i*j + j*k + k*i:
    #         if(i==j==k):
    #             count+=1
    #         elif(i==j or j==k or i == k):
    #             count+=3
    #         else:
    #             count+=6
    # print(count)


### FIXED CODE ###

import sys
import math
import itertools
# num = []
# for e in sys.stdin:
#     num.append(map(int, e.split()))

N = int(input())

count = []
for i in range(N):
    count.append(0)

max = min(int(math.sqrt(N)), int(N/2))
l = []

for i in range(1, max+1):
    l.append(i)

h = itertools.combinations_with_replacement(l, 3)

# print(h)
for i,j,k in h:
    n = (i+j+k)**2 - i*j - j*k - k*i
    # print(n)

    if(n <=N):
        if(i==j==k):
            count[n-1]+=1
        elif(i==j or j==k or i == k):
            count[n-1]+=3
        else:
            count[n-1]+=6


for c in count:
    print(c)

# for n in range(1, N+1):
#     count = 0;
#     max = min(int(math.sqrt(n)), int(n/2))
#     l = []
#
#     for i in range(1, max+1):
#         l.append(i)
#
#     h = list(itertools.combinations_with_replacement(l, 3))
#     for i,j,k in h:
#         if n == (i+j+k)**2 - i*j - j*k - k*i:
#             if(i==j==k):
#                 count+=1
#             elif(i==j or j==k or i == k):
#                 count+=3
#             else:
#                 count+=6

    # for i in range(1, max+1):
    #     for j in range(1, max+1):
    #         for k in range(1, max+1):
    #             num = i**2 + j**2 + k**2 + i*j + j*k + k*i
    #             if n == num:
    #                 count+=1
    # print(count)


    # print(max)


    # l = []
    #
    # for i in range(1, max+1):
    #     l.append(i)
    #
    # # h = itertools.combinations_with_replacement(l, 3)
    #
    # for i,j,k in h:
    #     if n == i**2 + j**2 + k**2 + i*j + j*k + k*i:
    #         if(i==j==k):
    #             count+=1
    #         elif(i==j or j==k or i == k):
    #             count+=3
    #         else:
    #             count+=6
    # print(count)
### BUGGY CODE ###

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

    from collections import deque
    from collections import Counter

    dq = deque(a)
    ans = []
    cnt = Counter(a)
    if cnt[1] == 1:
        print(1)
        return
    if cnt[1] > 1:
        print(0)
        return
    for i in range(n):
        if len(dq) == 0:
            break

        tmp = dq.popleft()

        for j in range(len(dq)):
            tmp2 = dq.popleft()
            if tmp2 % tmp == 0:
                continue
            dq.append(tmp2)
        if cnt[tmp] > 1:
            continue
        ans.append(tmp)

    print(len(ans))

if __name__=='__main__':
    main()


### FIXED CODE ###

from collections import Counter
import bisect
N = int(input())
A = list(map(int,input().split()))
cnt = Counter(A)
A.sort()
ans = 0
MX = 10**6
P = [0] * (MX+1)
for a in A:
    if P[a]==0:
        for i in range(MX+1):
            x = a*i
            if x > MX:
                break
            P[x] = 1
        if cnt[a]==1:
            ans+=1
print (ans)
### BUGGY CODE ###

import copy

N=int(input())
X=list(map(int,input().split(" ")))
for i in range(N):
  Y=copy.deepcopy(X)
  Y.pop(i)
  Y.sort()
  print(Y[(N-1)//2])

### FIXED CODE ###

import copy

N=int(input())
X=list(map(int,input().split(" ")))
Y=copy.deepcopy(X)
Y.sort()
a=Y[N//2]
b=Y[N//2-1]
for i in X:
  if i<=b:
    print(a)
  else:
    print(b)
### BUGGY CODE ###

from heapq import heappush, heappop, merge
from collections import defaultdict

N, Q = map(int, input().split())
events = []
for _ in range(N):
    s, t, x = map(int, input().split())
    events.append((s-x, 1, x))
    events.append((t-x, -1, x))
events = sorted(events)

constructions = []
under_construction = defaultdict(bool)
i = 0
for _ in range(Q):
    d = int(input())
    while i < 2*N and events[i][0] <= d:
        if events[i][1] > 0:
            heappush(constructions, events[i][2])
            under_construction[events[i][2]] = True
        else:
            under_construction[events[i][2]] = False
        i += 1
    while constructions:
        x = heappop(constructions)
        if under_construction[x]: # x is the minimum coordinate under construction
            heappush(constructions, x)
            print(x)
            break
    else: # no constructions
        print(-1)

### FIXED CODE ###

from heapq import heappush, heappop, merge
from collections import defaultdict
import sys
F = sys.stdin
def single_input(): return F.readline().strip("\n")
def line_input(): return F.readline().strip("\n").split()

def solve():
    N, Q = map(int, line_input())
    events = []
    for _ in range(N):
        s, t, x = map(int, line_input())
        events.append((s-x, 1, x))
        events.append((t-x, -1, x))
    for _ in range(Q):
        d = int(single_input())
        events.append((d, 2, d))
    events = sorted(events)

    constructions = []
    under_construction = defaultdict(bool)
    ans = ''
    for _, flag, coord in events:
        if flag == 1:
            heappush(constructions, coord)
            under_construction[coord] = True
        elif flag == -1:
            under_construction[coord] = False
        else:
            while constructions:
                x = heappop(constructions)
                if under_construction[x]: # x is the minimum coordinate under construction
                    heappush(constructions, x)
                    ans += str(x) + '\n'
                    break
            else: # no constructions
                ans += '-1\n'
    print(ans)
    
if __name__ == "__main__":
    solve()
### BUGGY CODE ###

from collections import defaultdict, Counter
import itertools

def solve(ah, aw, s: set):
    ahh, ahc = ah
    aww, awc = aw
    if (ahh, aww) in s:
        return ahc+awc-1
    else:
        return ahc + awc

def main():
    H, W, M = map(int, input().split())
    LH = []
    LM = []
    s = set()
    for _ in range(M):
        h, w = map(int, input().split())
        LH.append(h)
        LM.append(w)
        s.add((h,w))
    
    ch = Counter(LH)
    cm = Counter(LM)

    ah = ch.most_common()
    aw = cm.most_common()
    th = ah[0][1]
    tw = aw[0][1]
    #print("t=", th + tw)
    ah = [x for x in ah if x[1]==th]
    aw = [x for x in aw if x[1]==tw]
    ans = 0
    for x, y in itertools.product(ah, aw):
        ans = max(ans, solve(x, y, s))
    print(ans)
    


if __name__ == "__main__":
    main()

### FIXED CODE ###

from collections import Counter
import itertools

def solve(ah, aw, s: set):
    ahh, ahc = ah
    aww, awc = aw
    if (ahh, aww) in s:
        return ahc+awc-1
    else:
        return ahc + awc

def main():
    H, W, M = map(int, input().split())
    LH = []
    LM = []
    s = set()
    for _ in range(M):
        h, w = map(int, input().split())
        LH.append(h)
        LM.append(w)
        s.add((h,w))
    
    ch = Counter(LH)
    cm = Counter(LM)

    ahp = ch.most_common()
    awp = cm.most_common()
    th = ahp[0][1]
    tw = awp[0][1]
    #print("t=", th + tw)
    ah = []
    for x in ahp:
        if x[1] == th:
            ah.append(x)
        else:
            break
    aw = []
    for x in awp:
        if x[1] == tw:
            aw.append(x)
        else:
            break
    ans = solve(ah[0], aw[0], s)
    for x, y in itertools.product(ah, aw):
        z = solve(x, y, s)
        if z > ans:
            print(z)
            exit()
    print(ans)

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

S=input()
Q=int(input())
query=[]
for _ in range(Q):
    query.append(input().split())

for i in query:
    if i[0]=="1":
        S=S[::-1]
    else:
        if i[1]=="1":
            S=i[2]+S
        else:
            S=S+i[2]
print(S)

### FIXED CODE ###

S=input()
Q=int(input())
query=[]
for _ in range(Q):
    query.append(input().split())

flag = True
t=""
u=""

for i in query:
    if i[0]=="1":
        u,t=t,u
        flag = not flag
#        S=S[::-1]
    else:
        if i[1]=="1":
            t+=i[2]
        else:
            u+=i[2]
if flag:
    print(t[::-1]+S+u)
else:
    print(t[::-1]+S[::-1]+u)
### BUGGY CODE ###

import sys

s = list(input())
t = list(input())

for i in range(len(t)):
    if t[i] not in s:
        print(-1)
        sys.exit()

count = 0
for j in range(10000000000):
    for k in range(len(s)):
        if count == len(t):
            print(k +  (j * len(s)))
            sys.exit()
            
        #print(a[k +  (j * len(s))], t[count],a, count)
        if s[k] == t[count]:
            count += 1
            

### FIXED CODE ###

s = input()
t = input()
t_length = len(t)

temp = s[:]
count = 0
ans = 0

for i in range(len(t)):
    a = s.find(t[i])
    if a == -1:
        print(-1)
        exit()

while count < t_length:
    value = temp.find(t[count])
    if value == -1:
        ans += len(temp)
        temp = s[:]
    
    else:
        ans += value + 1
        count += 1
        temp = temp[value + 1:]

print(ans)