Polycarp has $$$n$$$ coins, the value of the $$$i$$$-th coin is $$$a_i$$$. Polycarp wants to distribute all the coins between his pockets, but he cannot put two coins with the same value into the same pocket.For example, if Polycarp has got six coins represented as an array $$$a = [1, 2, 4, 3, 3, 2]$$$, he can distribute the coins into two pockets as follows: $$$[1, 2, 3], [2, 3, 4]$$$.Polycarp wants to distribute all the coins with the minimum number of used pockets. Help him to do that.

The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of coins. The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 100$$$) — values of coins.

Print only one integer — the minimum number of pockets Polycarp needs to distribute all the coins so no two coins with the same value are put into the same pocket.

from collections import Counter
def mc(lst):
  data = Counter(lst)
  return data.most_common(1)[0][1]
n = int(input())
a = [int(x) for x in input().split(' ')]
print(mc(a))

#Codeforce 1003A
list1=[0]*100
coin=int(input())
str1=[int(v) for v in input().split()]
for i in range(len(str1)):
    list1[str1[i]-1] +=1
print(max(list1))

#1003A Polycarp's Pockets

n = int(input())
entrada = str(input())
entrada = entrada.split()
coins = [int(x) for x in entrada]

coins.sort()

counter = 1
values_counter = [1]

for i in range(1,n):
    if coins[i] == coins[i-1]:
        counter += 1
    else:
        values_counter.append(counter)
        counter = 1
    if i == n-1:
        values_counter.append(counter)

print(max(values_counter))

from collections import Counter
n = input()
a = Counter(raw_input().split())
print max(a.values())

n = input()
arr = map(int, raw_input().split())
d = {}
for num in arr:
    if num not in d: d[num] = 0
    d[num] += 1
m = 0
for key in d:
    m = max(m, d[key])
print m

from sys import stdin, stdout
ti = lambda : stdin.readline().strip()
ma = lambda fxn, ti : map(fxn, ti.split())
ol = lambda arr : stdout.write(' '.join(str(i) for i in arr) + '\n')
os = lambda i : stdout.write(str(i) + '\n')
olws = lambda arr : stdout.write(''.join(str(i) for i in arr) + '\n')

n = int(ti())
a = ma(int, ti())
d = {}
for i in a:
	if d.has_key(i):
		d[i] += 1
	else:
		d[i] = 1
os(max(d.values()))

import collections
n = int(input())
a = list(map(int, input().split()))
C = collections.Counter(a).most_common()
print(C[0][1])

n=int(input())
a=list(map(int,input().split()))
b=[0]*(max(a)+1)
for i in a:
    b[i]+=1
print(max(b))

from collections import Counter as c
n= int(input())
arr = list(map(int, input().split()))
a = c(arr)
b = max([value for value in a.values()])
print(b)

n = int(input())

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

l.sort()
c=1
counter=[]

if(n==1):print(1)
else:
    for i in range(1,n):
        if(l[i]==l[i-1]):
            c+=1

        else:
            counter.append(c)
            c=1

        if(i==n-1):counter.append(c)

    print(max(counter))

n = raw_input()
n = int(n)
a = raw_input().split()

b = [0 for i in range(100)]

for x in a:
    b[int(x) - 1] += 1

print max(b)

n = int(raw_input())
a = [int(t) for t in raw_input().split()]
d = {}
ans = 0
for x in a:
	if x not in d:
		d[x] = 0
	d[x] = d[x] + 1
	ans = max(ans, d[x])
print ans

n=int(input())
l=input().split()
li=[int(i) for i in l]
maxa=0
hashi=dict()
for i in li:
    if i in hashi:
        hashi[i]+=1
    else:
        hashi[i]=1
for i in hashi:
    maxa=max(maxa,hashi[i])
print(maxa)

n = int(input())
s = [int(x) for x in raw_input().split()]
s.sort()
count = 0
max = 0
i = 0
while i<n:
	a = s[i]
	count = 1
	i+=1
	while(i<n and s[i]==a):
		count+=1
		i+=1
	if(count>max):
		max = count
print max

n=int(input())
ar=[0]*101
fr=[int(p) for p in input().split()]
for i in range(n):
    x=fr[i]
    ar[x]+=1
ar.sort()
print(ar[100])

n = input()
arr = list(map(int,input().split()))
new_arr = list(set(arr))
maxx = 0
for i in new_arr:
    ans = arr.count(i)
    if ans>=maxx:
        maxx = ans
print(maxx)

n=int(input())
a=list(map(int,input().split()))
a.sort()
x=a[0]
b=[]
y=0
for i in range(1,n):
    if x!=a[i]:
        if y>0:
            b.append(y)
        x = a[i]
        y=0
    else:
        y=y+1
        if i==n-1:
            b.append(y)
if b==[]:
    print(1)
else:
    print(max(b)+1)

n= int(input())
a=input().split()
count=0
new=1
b=[]
for i in a:
    b.append(a.count(i))

print(max(b))

m=0
k=0
import math
a=int(input())
b=list(map(int,input().split()))
b.sort()
i=b[a-1]
b.append(0)
for i in range(a):
    if b[i]==b[i+1]:
        m+=1
    else:
        if m> k:
            k=m
        m=0
print(k+1)

n = int(input())
a = [int(x) for x in input().split()]
b=1
for i in a:
    b = max(b, a.count(i))
print(b)

n=int(input())
a=list(map(int,input().split()))
b=a.count(max(set(a), key=a.count))
print(b)

n=int(input())
m=list()
c=int(1)
a=list(map(int,input().split()))
a.sort()
for i in range(n-1):
    if a[i]==a[i+1]:
        c+=1
    #elif a[n-1]==a[n-2]:
     #   c+=1
    else:
        m.append(c)
        c=1
#if a[n-1]==a[n-2]:
#    c+=1
m.append(c)
#print(m)
m.sort()
#print(m)
print(m[len(m)-1])

t=input()
d=map(int,raw_input().split())
ma={}
maximum=1
for i in d:
	if ma.has_key(i):
		ma[i]+=1
		if ma[i]>maximum:
			maximum=ma[i]
	else:
		ma[i]=1
print maximum

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

a_used = [0]*n
ans = 0

while 0 in a_used:
	ans+=1
	tmp = []
	for i in range(n):
		if a[i] not in tmp and a_used[i] == 0:
			tmp.append(a[i])
			a_used[i] = 1

print(ans)

def countPockets():
    MAX_COIN_VALUE = 100
    coinCount = int(raw_input())
    coins = [int(c) for c in raw_input().split(' ')]
    coinsMap = [0] * MAX_COIN_VALUE

    for coin in coins:
        coinsMap[coin-1] += 1

    print(max(coinsMap))

countPockets()

import collections
n = int(input())
A = list(map(int,input().split()))
C = collections.Counter(A)
ans = max(C.values())
print(ans)

from collections import Counter

def find_pockets(arr):
    ctr = Counter(arr)
    values = list(ctr.values())
    pockets = 0
    while values:
        values = [c-1 for c in values if c != 0]
        pockets += 1
    print(pockets-1)

if __name__ == '__main__':
    n = input()
    arr = list(map(int, input().split()))
    find_pockets(arr)

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

max = 0
for i in range(1,101) :

    x = a.count(i)

    if x > max :
        max = x

print max

n = int(input())
a = sorted(list(map(int, input().split())))
solution = 1
count = 1
last = a[0]
for i in a[1:]:
    if last == i:
        count += 1
    else:
        count = 1
    solution = max(solution, count)
    last = i
print(solution)

n=int(input())
arr=input().split()
for i in range(n):
    arr[i]=int(arr[i])
max=0
for i in arr:
    j=arr.count(i)
    if(max<j):
        max=j

print(max)

n=int(input())
list=[int(item) for item in input().split()]
if(n==1):
    print(1)
else:
    list.sort()
    prev=list[0]
    sizes=[1]
    cnt=1
    for i in range(1,n):
        if(list[i]==prev):
            cnt+=1
        else:
            sizes.append(cnt)
            cnt=1
        prev=list[i]
    sizes.append(cnt)
    print(max(sizes))

arr=[0]*101
ans = 0

n=int(input())
rrr = [0]*999
rrr=list(map(int, input().split()))

for i in range(0,n):
    arr[rrr[i]]+=1
    ans = max(ans, arr[rrr[i]])

print(ans)

n=int(input())
a=list(map(int,input().split()))
a.sort()
k = 0
x = 0
for i in range(1, n):
    if a[i] == a[i-1]:
        k+=1
    else:
        if k > x:
            x = k
        k = 0
if x <= k:
    x = k
print(x+1)

from collections import Counter
n=int(input())
arr=list(map(int,input().split()))
c=Counter(arr)
m=1
for key,value in c.items():
		if(value>m):
			m=value
print(m)

n = int(input())
A = list(map(int,input().split()))
cnt = [0 for i in range(max(A)+1)]
ans = 0
for i in A:
    cnt[i]+=1
    ans = max(cnt[i],ans)
print(ans)

n = int(input())
a = list(map(int,input().strip().split()))[:n]

flag = 1
b = []
for i in range(n) :
    x = a[i+1:n]
    y = x.count(a[i])
    b.append(y+1)
print(max(b))

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
m = 1
l = -1
s = 0
for i in range(0, n):
	if a[i] == l:
		s+=1
	else:
		m = max(s, m)
		l = a[i]
		s = 1
m = max(s, m)
print(m)

n=int(input())
a=list(map(int,input().split()))
d,mx={},-1e64
for v in a:
    if v in d:
        d[v]+=1
    else:
        d[v]=1
for k in d:
    mx=max(mx,d[k])
print(mx)

n=int(input())
ar=list(map(int,input().split()))
cnt=[0 for i in range(101)]
for i in range(n):
    cnt[ar[i]]+=1
print(max(cnt))

n=input()
d=[int(z) for z in raw_input().split(' ')]
s=[]

for i in d:
	s.append(d.count(i))
print max(s)

n = int(input())
a = []
ainp = raw_input()

ai = ainp.split(" ")
for i in range(0,n):
	a.append(int(ai[i]))

ans = 0
for i in range(0,n):
	count = 0
	for j in range(0,n):
		if a[i] == a[j] :
			count+=1

	if count > ans:
		ans = count

print(ans)

n = int(input())
a = list(map(int,input().split()))
max_n = 0
for i in a:
    if a.count(i)>max_n:
        max_n = a.count(i)

print(max_n)

from collections import Counter
n=int(raw_input())
l=map(int,raw_input().split())
a=Counter(l)
b=a.keys()
l1=[]
for i in range(len(b)):
    l1.append(a[b[i]])
print max(l1)

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
cur_ans = 1
ans = 1
for i in range(1,n):
    if a[i] == a[i-1]:
        cur_ans += 1
    else:
        ans = max(ans, cur_ans)
        cur_ans = 1
ans = max(ans, cur_ans)
print(ans)

inp=input
li=list
iinp=lambda : int(inp())
ent=lambda : map(int,inp().split())
lient=lambda : [int(i) for i in inp().split()]
li0= lambda x: [0 for i in range(x)]
stent=lambda : [i for i in inp()]

from collections import Counter
n=iinp()
monedas=lient()
ma=Counter(monedas)
res=max(ma.values())
print(res)

def do():
    n = int(input())
    dat = list(map(int, input().split()))
    import collections
    c = collections.Counter(dat)
    res = c.most_common(1)[0][1]
    print(res)

do()

def templ():
    #input = sys.stdin.readline
    from pprint import pprint
    #import sys
    #sys.setrecursionlimit(100000)

    q = int(input())
    for _ in range(q):
        s = input()
        n = int(input())
        n, k = map(int, input().split())
        dat = list(map(int, input().split()))

    dat = [1, 2, 3]
    print(" ".join(list(map(str, res))))

    pass
    import math
    math.ceil(1.2)
    math.floor(1.2)
    round(1.2, 3)

n=int(input())
a=list(map(int,input().split()))
a.sort()
i=0
mx=0
while i<n:
    x=a.count(a[i])
    i+=x
    if x > mx:
        mx=x
print(mx)

raw_input()
ar = map(int, raw_input().split())
c = 0

for i in xrange(101):
    co = 0
    for j in ar:
        if j == i:
            co += 1
    c = max(c, co)

print c

n=int(input())
l=list(map(int,raw_input().strip().split()))
s=set(l)
t=[]
if n==len(s):
    print("1")
else:
    for i in s:
        t +=[l.count(i)]
    print(max(t))

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

ar = [0]*101
for i in a:
    ar[i] += 1

print(max(ar))

n=int(input())
l=list(map(int,input().split()))
p=set(l)
m=[]
for i in p:
    m.append(l.count(i))
print(max(m))

n = int(input())
a = sorted(list(map(int, input().split())))
solution = 1
count = 1
last = a[0]
for i in a[1:]:
    if last == i:
        count += 1
        solution = max(solution, count)
    else:
        count = 1
    last = i
print(solution)

n = int(input())
a = [int(x) for x in input().split()]
b=1
for i in a:
    b = max(b, a.count(i))
print(b)

n = int(input())
l = list(map(int, input().split()))
ans = 0
k = set(l)

for i in k:
    c = l.count(i)
    if c > ans:
        ans = c
    else:
        continue

print(ans)

from collections import Counter
input()
l=list(map(int,input().split()))
print(max(Counter(l).values()))

n=int(raw_input())

inputs=raw_input().split()

coins={}

for i in inputs:
    if int(i) not in coins.keys():
        coins[int(i)]=1
    else:
        coins[int(i)] += 1

pockets=coins[coins.keys()[0]]

for i in coins:
    if coins[i] > pockets:
        pockets = coins[i]

print pockets

from collections import Counter
n = int(input())
print(max(Counter(map(int, input().split())).values()))

n=input()
s=map(int,raw_input().split(" "))
a=s[0]
m=1
q=1
s.sort()
for i in range(1,len(s)):
    if s[i]==s[i-1]:
        m+=1
    else:
        m=1
    if q<m:
        q=m
print q

N = int(1e2 + 1)
fr = [0] * N

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

for item in a:
  fr[item] += 1

print(sorted(fr)[-1])

a=int(input())
b=list(map(int,input().split()))
c=[0]*101
for i in range(len(b)):
    c[b[i]]+=1
print(max(c))

n = int(input())
l = list(map(int,input().split()))
l2 = []
for i in l :
    l2.append(l.count(i))

if len(set(l)) == 1 :
    print(n)

elif len(set(l)) == n :
    print('1')

else:
    print(max(l2))

n = input()
a = sorted(map(int,raw_input().split()))
a.append(-1)

i=0
c=1
ans = 0
while i<n:
	if a[i] != a[i+1]:
		ans = max(ans, c)
		c=1
	else:
		c += 1
	i += 1
print ans

n=int(raw_input())
a=map(int, raw_input().split())
dic={}
for i in a:
    if i in dic:
        dic[i]+=1
    else:
        dic[i]=1
ans=0
for k in dic:
    ans=max(ans,dic[k])
print ans

from sys import stdin
n = int(stdin.readline())
a = map(int,stdin.readline().split())
b={}
for i in a:
    b[i]=b.get(i,0)+1
x=0
for i in b:
    x=max(x,b[i])
print x

input()
n = list(map(int, input().split()))
f = 0
for i in n:
    if n.count(i) > f:
        f = n.count(i)
print(f)

n=int(input())
arr=[int(i) for i in input().split()]
x=list(map(lambda x:arr.count(x),arr))
print(max(x))

n=input()
s=raw_input()
l=s.split()
min=1
for t in range(1,n):
    if l[t]==l[0]:
        min+=1
for i in range(1,n):
    temp=1
    for j in range(i+1,n):
        if l[j]==l[i]:
            temp+=1
    if temp>min:
        min=temp
print min

n=(int)(input())
l=list(map(int,input().split()))
    # a,b=map(int,input().split())
ar=[0]*101
for i in range(n):
    ar[l[i]]+=1
ar.sort()
print(ar[100])

'''
1003a
-----

'''

n=input()
L=raw_input()
x=L.split()
arr=[]

for i in x:
    arr.append(int(i))

maxc=0

for i in arr:
    n=arr.count(i)
    if n>=maxc:
        maxc=n

print maxc

n=int(input())
l=list(map(int,raw_input().strip().split()))
s=set(l)
t=[]
if n==len(s):
    print("1")
else:
    for i in s:
        t +=[l.count(i)]
    print(max(t))

a=int(input())
b=list(map(int,input().split()))
c=0
for i in range(a):
    count=b.count(b[i])
    if count>c:
        c=count
print(c)

n = int(input())
l = list(map(int, input().split()))
m = max(l)
ans = []
i = 0
while i <= m:
    ans.append(0)
    i += 1
y = 0
while y < n:
    ans[l[y]] += 1
    y += 1
print(max(ans))

n = int(raw_input())
l = map(int, raw_input().split())
s = set()
maior = 0

for i in xrange(n):
  s.add(l[i])
for i in xrange(len(s)):
  tmp = l.count(s.pop())
  if(tmp > maior):
    maior = tmp

print(maior)

import operator
n = int(input())
mas = list(map(int, input().split()))
d = {}
uniq = set(sorted(mas))
for i in uniq:
    d[i] = 0
for i in mas:
    d[i] += 1
print(max(d.values()))

from collections import Counter

n = int(input())
a = [int(s) for s in input().split()]

print(Counter(a).most_common(1)[0][1])

n = int(raw_input())

ar = sorted(map(int, raw_input().split()))

f = []

for i in ar:
	f.append(ar.count(i))

print max(f)

class Main:
    def __init__(self):
        self.n = int(input())
        self.a = [int(x) for x in input().split()]

    def main(self):
        print(max(self.a.count(x) for x in set(self.a)))

if __name__ == "__main__":
    Main().main()

n=int(input())
ar=input().split()
f=[0]*101
for i in range (0,n):
    ar[i]=int(ar[i])
    f[ar[i]]+=1
print(max(f))

n=input()
import collections
l=map(int,raw_input().split())
d=collections.Counter(l)
print max(d.values())

n=int(input())
count=0
z=1
ar=sorted(list(map(int,input().split())))
for i in range(len(ar)-1):
    if ar[i+1]==ar[i]:
        count+=1
    else:
        z=max(z,count+1)
        count=0
print(max(count+1,z))

from collections import *
n = int(input())
a = list(map(int,input().split()))
c = Counter(a)
print(max(c.values()))

from collections import Counter
print '' if raw_input() == 0 else '' + str(Counter(map(int, raw_input().split(' '))).most_common(1)[0][1])

n=int(input())
l=input().split()
li=[int(i) for i in l]
maxa=0
hashi=dict()
for i in li:
    if i in hashi:
        hashi[i]+=1
    else:
        hashi[i]=1
for i in hashi:
    maxa=max(maxa,hashi[i])
print(maxa)

import collections

n = input()
l = map(int, raw_input().split())
m = collections.Counter(l).values()
print max(m)

n = input()
string = raw_input()
list = []
list = string.split()
for a in range (0, n):
    list[a] = int(list[a])
dic = {}
for a in list:
    dic[a] = 0
for a in list:
    dic[a] += 1
maxi = 0
for a in range (0, len(dic.values())):
    maxi = max(maxi, dic.values()[a])
print maxi

import collections
n = int(input())
a = list(map(int, input().split()))
C = collections.Counter(a).most_common()
print(C[0][1])

n = int(input())
a = list(map(int,input().split()))
max_n = 0
for i in a:
    if a.count(i)>max_n:
        max_n = a.count(i)

print(max_n)

n=int(input())
a=list(map(int,input().split()))
a.sort()
k = 0
x = 0
for i in range(1, n):
    if a[i] == a[i-1]:
        k+=1
    else:
        if k > x:
            x = k
        k = 0
if x <= k:
    x = k
print(x+1)

import collections
n = int(input())
A = list(map(int,input().split()))
C = collections.Counter(A)
ans = max(C.values())
print(ans)

from collections import Counter
n = int(raw_input())
lis=map(int,raw_input().split())
s=Counter(lis)
tt=[]
for i in s.values():
    tt.append(i)
print max(tt)

n=input()
d=[int(z) for z in raw_input().split(' ')]
s=[]

for i in d:
	s.append(d.count(i))
print max(s)

n = int(input())
ls = list(map(int,input().split()))
ls.sort()
ans = 1
i=0
while i < len(ls)-1:
    cnt = 1
    while ls[i] == ls[i+1]:
        cnt+=1
        i+=1
        if i==n-1:
            break
    i+=1
    ans=max(ans,cnt)
print(ans)

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

b=[0]*100

for i in range(n):
    b[a[i]-1]+=1

print max(b)

n=input()
s=raw_input()
l=s.split()
min=1
for t in range(1,n):
    if l[t]==l[0]:
        min+=1
for i in range(1,n):
    temp=1
    for j in range(i+1,n):
        if l[j]==l[i]:
            temp+=1
    if temp>min:
        min=temp
print min

s = int(input())
n = list(map(int, input().split()))
answer = 0
for i in range (100):
 d= n.count(i)
 if d>answer:
   answer = d
print(answer)

a = int(input())
li = sorted(list(map(int, input().split())))
b = 0
for i in range(a-1):
    if li[i] == li[i+1]:
        b += 1
if b == 0:
    print(1)
else:
    print(b)

input()
a = list(map(int,input().split()))
b = list(set(a))
tot=0
k=0
if len(b)==len(a):
    print("1")
elif len(a)%len(b)==0:
    tot=int(len(a)/len(b))
    print(tot)
elif (len(a)/2)<len(b):
    tot=int(len(a)/len(b))
    print(tot+1)
else:
    tot=int(len(a)/2)
    print(tot+1)

# -*- coding: utf-8 -*-
"""
Created on Tue May 28 20:03:18 2019

@author: fsshakkhor
"""

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

ans = 1
st = set()
for i in range(len(ara)):
    if ara[i] in st:
        ans += 1
        st.clear()
    else:
        st.add(ara[i])

print(ans)

n = int(input())
numbers = list(map(int, input().split(" ")))
ls = [[numbers[0]]]
for i in range(1,n):
    flag = 0
    for j in range(0, len(ls)):
        if i not in ls[j]:
            ls[j].append(numbers[i])
            flag = 1
            break
    if flag == 0:
        ls.append([numbers[i]])
print(ls)
print(len(ls))

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

if len(set(l)) == n :
    print('1')

else:
    print('2')

n=int(input())
a=list(map(int,input().split()))
a.sort()
x=a[0]
b=[]
y=0
for i in range(1,n):
    if x!=a[i]:
        if y>0:
            b.append(y)
        x = a[i]
        y=0
    else:
        y=y+1
if b==[]:
    print(n)
else:
    print(max(b)+1)

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
m = 1
l = -1
s = 0
for i in range(0, n):
	if a[i] == l:
		s+=1
	else:
		m = max(s, m)
		l = a[i]
		s = 1
print(m)

COINS = int(input())

ARRAY = list()

SPLIT = input().split(' ')

for i in range(COINS):
    ARRAY.append(int(SPLIT[i]))

COUNT = 1

ARRAY.sort()
highest_val = 0
for i in range(len(ARRAY)):
    num = ARRAY.count(i)
    if highest_val < num:
        highest_val = num
    COUNT = highest_val

print(str(COUNT))

x = int(input())
y = list(map(int , input().split()))
y.sort()
win = 0

for c in range (101):
    if y.count(c) > win:
        win = c

print(win)
print(y.count(win+1))

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

if len(set(l)) < len(l):
    print(2)
else:
    print(1)

n = int(input())
if n != 0:
    a = list(map(int, input().split()))

    b = [0] * n
    for i in range(n):
        b[i] = set()

    c = 1
    for elem in a:
        for i in range(c):
            if not (elem in b[i]):
                b[i].add(elem)
                break
        else:
            b[c-1].add(elem)
            c += 1
    print(c)
else:
    print(0)

m=0
import math
a=int(input())
b=list(map(int,input().split()))
for i in range(a):
    k=0
    for j in range (a):
        if b[j]==b[i]:
            k+=1
    if k>m:
        m=k
print(int(k))

n = int(input())
a = sorted(list(map(int, input().split())))
print(a)
solution = 1
count = 1
last = a[0]
for i in a[1:]:
    if last == i:
        count += 1
    else:
        count = 1
    solution = max(solution, count)
    last = i
print(solution)

n = int(input())
a = [int(x) for x in input().split()]
b = []
for i in range(n):
    b = [a.count(a[i])]
print(max(b))

x = int(input())
y = list(map(int , input().split()))
y.sort()
win = 0

for c in range (101):
    if y.count(c) > win:
        win = c

print(y.count(win+1))

n=int(input())
m=list(map(int,input().split()))
x=[m.count(i) for i in range(n)]
print(max(x))

n = int(input())
arr = list(map(int, input().split()))
for i in range(n):
    if not arr[i] & 1:
        arr[i] -= 1
print(*arr)

def answer():
    n = int(input())
    a = [int(x) for x in input().split()]
    c = []
    i=0
    a.sort()
    while i<len(a):
        targ=a[i]
        j=0
        homeless=1
        while j<len(c):
            cell = c[j]
            k=0
            ruined=0
            if targ in cell:
                pass
            else:
                cell.append(targ)
                homeless=0
                break
            j+=1
        if homeless:
            c.append([targ])
        i+=1
    print(len(c),c)

answer()

n = int(input())
#a = list(map(int,input().split()))
a = input()
f = {}
maxf = -1

for i in a:
	t = int(i) if i != ' ' else 0
	if t == 0:
		continue
	try:
		x = f[t]
	except:
		x = 0
	f[t] = x + 1
	if f[t] > maxf:
		maxf = f[t]

print(max(f))

n=int(input())
arr=[int(x) for x in input().split()]
arr.sort()
pocket=1
i=0
while i<n-1:
    if arr[i+1]==arr[i]:
        pocket+=1
    i+=1
print(pocket)

a = int(input())
li = sorted(list(map(int, input().split())))
b = 0
for i in range(a-1):
    if li[i] == li[i+1]:
        b+=1
if b == 0:
    print(1)
elif b == a-1:
    print(a)
else:
    print(b)

x = int(input())
if x == 0:
    exit(0)
numbers = list(map(int, input().split()))
if len(numbers) == 1:
    print(1)
    exit(0)
new_list = []
count = 0
if numbers.count(numbers[0]) == x:
    print(x)
    exit(0)
for i in range(len(numbers)):
    if numbers[i] not in new_list:
        new_list.append(numbers[i])
    else:
        count = count + 1
        new_list.clear()
print(count + 1)

a=int(input())
b=list(map(int,input().rstrip().split()))
c=[0]*101
count=0
b.sort()
print(b)
for x in range(101):
    count=0
    for y in range(a):
        if x==b[y]:
            count+=1
    c[x]=count

c.sort()

print(c[100])

charNum = int(input())
string = input()
k = 0
ans = ""
for i in range(0,len(string)):
    if string[i] == "B":
        k += 1
    else:
        if k > 0:
            ans += str(k)+ " "
            k = 0
ansNum = ans[:-1].split(" ")
print(len(ansNum))
print(ans)

n = input()
b =list(map(int,input().split()))
flag = [0 for i in range(110)]
for i in b:
    flag[i]+=1
s = set()
for i in range(110):
    s.add(flag[i])
print(len(s)-1)

n = int(input())
count = 0
l = list(map(int, input().split()))
for i in range(n):
    for j in range(i + 1, n):
        if(l[i] == l[j]):
            count += 1
print(count)

n = int(input())
lis = input().split(" ")
count=0
Max=0

for i in range(0,len(lis)):
    for k in range(1,i):
        if lis[i]==lis[k]:
            count+=1
            print(i,lis[i],k,lis[k],count)
            if count>Max:
                Max=count
if Max==0:
    Max+=1

print(Max)

n = int(input())
a = input().split(' ')
l = set(a)
if len(a) - len(l) == 0:
    print("1")
else:
    print(len(a) - len(l))

n=int(input())
a=list(map(int,input().split()))
s=set(a)
c=[]
for i in s:
    t=a.count(i)
    c.append(t)
if len(c)>1:
    m=max(c)
    t=c.count(m)
    if t==len(c):
        print(t)
    else:
        print(m)
else:
    print(n)

#http://codeforces.com/contest/1003/problem/0
n=int(input())
c=list(map(int,input().split()))
A=list(set(c))
if len(A)==1 or len(A)==len(c):
    ans=1
else:
    ans=2
print(ans)

n = int(input())

n = input()
coins=[]

for x in n.split(" "):
    coins.append(int(x))

coins = sorted(coins)

poc = []
dup = []
add = 0
temp = 0

for x in coins :

    if int(x) not in poc :
        poc.append(int(x))
        temp = temp + abs(temp-add)
        add = 0

    else:
        if int(x) not in dup :
            dup.append(int(x))
        else:
            add+=1

if len(dup) >= 1:
    if add > 0 :
        temp = temp+ abs(temp-add)
        print (1+1+temp)
    else:
        print (1+1+temp)

else:
    print (1)

n = 1
a = [100]
k = 1
i = 0
for i in a:
    if a.count(i) >= 2:
        k += 1
print(k)

n = int(input())
mas = list(map(int, input().split()))
d = {}
uniq = set(sorted(mas))
for i in uniq:
    d[i] = 0
for i in mas:
    d[i] += 1
print(d[max(d)])

n=int(input())
st=input().split(" ")
arr=[int(x) for x in st]
dic={}
for i in arr:
    dic[i]=dic.get(i,0)+1
print(max(dic, key=dic.get))

def main():
    n = int(input()) #   Input N
    arr = list(map(int, input().split(' ')))  #  Input Array

    pockets = []
    hand = []

    for coin in arr:
        if coin not in hand:
            hand.append(coin)
        else:
            hand = [coin]
            pockets.append(hand)

    print(len(pockets) if not hand else len(pockets) + 1)

if __name__ == '__main__':
    main()

n=int(input())
x=input().split()
a=0
flag=0
for i in range(len(x)):
	for j in range(i+1,len(x)):
		# print(x[i],x[j])
		if x[i]==x[j]:
			a+=1
			flag=1
			break
if flag == 1:
	print(a)
else :
	a=1
	print(a)

from math import ceil
I = input
n = int(I())
coins = I().split()
A = []
B = []

for i in range(0,n):
	if coins[i] not in A:
		A.append(coins[i])
	else:
		B.append(coins[i])

if len(A) > 0 and len(B)>0:
	print(2)
else:
	print(1)

# -*- coding:utf-8 -*-
#[n, m] = [int(x) for x in raw_input().split()]

cache = {}
def some_func():
    """
    """
    n = input()
    n_list = [int(x) for x in raw_input().split()]
    for v in n_list:
        cache[v] = 1

    return n-len(cache)+1

if __name__ == '__main__':
    print some_func()

x = int(input())
y = list(map(int , input().split()))
y.sort()
win = 0

for c in range (101):
    if y.count(c) > win:
        win = c

if x == 100 and y[0] == 99:
    print(99)
else:
    print(y.count(win))

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

b = set(a)

print(len(a) - len(b) if len(a) - len(b) > 0 else 1)

raw_input()
ar = ' ' + raw_input() + ' '

c = 0
for i in xrange(101):
    c = max(c, ar.count(' ' + str(i) + ' '))

print c

n=int(input())
list=[int(item) for item in input().split()]
list.sort()
print(list)
prev=list[0]
sizes=[]
cnt=0
for i in range(1,n):
    if(list[i]==prev):
        cnt+=1
    else:
        sizes.append(cnt)
        cnt=1
    prev=list[i]
print(max(sizes))

import sys

input = sys.stdin.readline

############ ---- Input Functions ---- ############
def inp():
    return (int(input()))

def inlt():
    return (list(map(int, input().split())))

def insr():
    s = input()
    return list(s[:len(s) - 1])

def invr():
    return (map(int, input().split()))

def Count_Repeat(x):
    _size = len(x)
    #repeated = []
    count = 0
    for i in range(_size):
        k = i + 1
        for j in range(k, _size):
            if x[i] == x[j] :
                count = count+1
    return count

t= inp()
list = inlt()
c = Count_Repeat(list)
if c == 0:
    print(1)
else :
    print(c)

n=int(input())
a=list(map(int,input().split()))
a.sort()
x=a[0]
b=[]
y=0
for i in range(1,n):
    if x!=a[i]:
        if y>0:
            b.append(y)
        x = a[i]
        y=0
    else:
        y=y+1
if b==[]:
    print(1)
else:
    print(max(b)+1)

n = int(input())
mas = list(map(int, input().split()))
d = {}
uniq = set(sorted(mas))
for i in uniq:
    d[i] = 0
for i in mas:
    d[i] += 1
print(max(d, key=d.get))

a=int(input())
b=list(map(int,input().rstrip().split()))
r=len(b)
c=[0]*101
count=0
for x in range(101):
    count=0
    for y in range(r):
        if x==b[y]:
            count+=1
    c[x]=count

c.sort()
print(c[99])

from collections import Counter

def find_pockets(arr):
    ctr = Counter(arr)
    values = list(ctr.values())
    print("The values are", values)
    pockets = 0
    while values:
        values = [c-1 for c in values if c != 0]
        print(values)
        pockets += 1
    print(pockets-1)

if __name__ == '__main__':
    n = input()
    arr = list(map(int, input().split()))
    find_pockets(arr)

n = int(input())
s = [int(x) for x in input().split(' ')]
if len(s) - len(set(s)) == 0:
  print(1)
else:
  print(len(s) - len(set(s)))

n = int(input())
a = [int(_) for _ in input().split()]
for i in a:
    if a.count(i)>1:
        print(a.count(i))
        break
    else:
        print('1')
        break

COINS = int(input())

ARRAY = list()

SPLIT = input().split(' ')

for i in range(COINS):
    ARRAY.append(int(SPLIT[i]))

COUNT = '1'

ARRAY.sort()
highest_val = 0
for i in range(len(ARRAY)):
    num = ARRAY.count(i)
    if highest_val < num:
        COUNT = str(num)

print(COUNT)

n = int(input())
lis = input().split(" ")
count=0
Max=0

for i in range(0,len(lis)):
    for k in range(1,i):
        if lis[i]==lis[k]:
            count+=1
            if count>Max:
                Max=count
if Max==0:
    Max+=1

print(Max)

x = int(input())
y = list(map(int , input().split()))
y.sort()
win = 0

for c in range (101):
    if y.count(c) > win:
        win = c+1

print(win)
print(y.count(win))

n = int(input())
s = [int(x) for x in input().split(' ')]
if len(s) - len(set(s)) == 0:
  print(1)
elif len(set(s)) == 1:
  print(len(s))
else:
  print(len(s) - len(set(s)))

m=0
import math
a=int(input())
b=list(map(int,input().split()))
for i in range(a):
    k=0
    for j in range (a):
        if b[j]==b[i]:
            k+=1
    q=math.sqrt(k)
    if q>m:
        m=q
print(int(m+0.999))

n = int(input())
a = [int(x) for x in input().split()]
b = []
for i in range(n):
    b = [a.count(a[i])]
print(max(b))

n = int(input())
l = sorted(list(map(int,input().split())))
ma = 0
h = 0
for f in range(n-1) :
    if l[f] == l[f+1] :
        h += 1
    else :
        if h > ma :
            ma = h
            h = 0
print(ma)

from sys import stdin
from collections import defaultdict
n = int(stdin.readline().rstrip())
chars = stdin.readline().rstrip()
c = defaultdict(int)

for char in chars:
    c[char] += 1

ones = min(c['o'], c['n'], c['e'])
c['o'] -= ones; c['n'] -= ones; c['e'] -= ones

zeroes = min(c['z'], c['e'], c['r'], c['o'])

for i in range(ones):
    print('{} '.format(1), end='')

for i in range(zeroes):
    print('{} '.format(0), end='')

n = int(input())
l = sorted(list(map(int,input().split())))
ma = 0
h = 1
for f in range(n-1) :
    if l[f] == l[f+1] :
        h += 1
        if h > ma : ma = h
    else : h = 1
print(ma)

class pockets:

    def __init__(self,m):
        self.m=[]
        self.m.append(m)

c=int(input())
val=[]
p=1
val=list(map(int,input().strip().split(" ")))
#for i in range(c):
 #   val.append(int(input()))

l=[]

for i in range(c):
	if (len(l)<1):
	    l.append(pockets(val[i]))
	    #print("first coin",val[i]," added and number of pockets=",p,"\n")
	else:
		for j in range (len(l)):
			added=0
			if val[i] not in l[j].m:
				l[j].m.append(val[i])
				#print("new coin",val[i]," added in old pocketand number of pockets=",p,"\n")
				added=1
				break
			else:
				continue
		if added is 0:
			l.append(pockets(val[i]))
			p=p+1
			#print("new coin",val[i]," added in new pocketand number of pockets=",p,"\n")
			break

print(p)

n = int(input())
a = list(map(int,input().split()))
k = 0
for i in a:
    k += 1
c = set(a)
b = 0
for i in c:
    b += 1
j = k - b
if b == 1:
    j += 1
    print(j)
else:
    print(j)

t=input()
d=map(int,raw_input().split())
ma={}
maximum=0
for i in d:
	if ma.has_key(i):
		ma[i]+=1
		if ma[i]>maximum:
			maximum=ma[i]
	else:
		ma[i]=1
print maximum

n=int(input())
a=list(map(int, input().split()))
for i in a:
    x=a.count(i)
print(x)

try:
    n=int(input())
    l=list(map(int,input().split()))
    cnt=0
    for i in l:
        if l.count(i)>=2:
            cnt+=1
    a=n-cnt
    if a==n:
        print(1)
    else:
        print(cnt)
except:
    pass

#1003A Polycarp's Pockets

n = int(input())
entrada = str(input())
entrada = entrada.split()
coins = [int(x) for x in entrada]

coins.sort()

counter = 1
values_counter = [1]

for i in range(1,n):
    if coins[i] == coins[i-1]:
        counter += 1
    else:
        values_counter.append(counter)
        counter = 1

print(max(values_counter))

n=int(input())
s=list(map(int,input().split()))
ans=-1
for i in s:
    x=s.count(i)
    if x>ans:
        ans=x
print(x)

n = int(raw_input())
a = map(int, raw_input().strip().split())
if n <= 1:
    print(n)
else:
    a = sorted(a)

    result = 0
    current = 1
    prev = -1

    for item in a:
        if prev == item:
            current += 1
        else:
            if current > result:
                result = current
            current = 1
        prev = item

    print(result)

n = int(input())

coins = input()

poc = []
dup = []

for x in coins.split(" ") :
    if int(x) not in poc :
        poc.append(int(x))

    else:
        dup.append(int(x))

if len(dup) > 1:
    dup = sorted(dup)

    add = 1
    for y in range(1,len(dup)):
        if dup[y] == dup[y-1]:
            add += 1

        else:
            pass

elif len(dup) == 1 :
    add = 1

else:
    add = 0

print (1 + add)

from math import ceil
I = input
n = int(I())
coins = I().split()
A = []
B = []
if n == 1:
	print(1)
else:
	for i in range(0,n):
		if coins[i] not in A:
			A.append(coins[i])
		else:
			B.append(coins[i])
	A = set(A)
	B = set(B)
	if len(A.intersection(B)) > 0:
		print(2)
	else:
		print(1)

n=int(input())
arr=list(map(int,input().split()))
ted=[0 for i in range(110)]
for x in arr:
	ted[x]+=1
ans=0
while True:
	mx=max(ted)
	# print(mx)
	if mx==0:
		break
	ind=0
	for i in range(110):
		if ted[i]==mx:
			ind=i
			break
	while ted[ind]==mx:
		ted[ind]-=1
		ind+=1
	ans+=1
print(ans)

n=int(input())
count=0
z=1
ar=sorted(list(map(int,input().split())))
for i in range(len(ar)-1):
    if ar[i+1]==ar[i]:
        count+=1
    z=max(z,count+1)
    count=0
print(z)

n = int(input())
A = list(map(int, input().split()))
print(n - len(set(A)))

n = int(input())
a = list(map(int,input().split()))
k = 0
i = 0
for i in a:
    if a.count(i) >= 2:
        k += 1
    else:
        k = 1
print(k)

def main():
    n = int(input()) #   Input N
    arr = list(map(int, input().split(' ')))  #  Input Array

    pockets = []
    hand = []

    for coin in arr:
        if coin not in hand:
            hand.append(coin)
        else:
            pockets.append(hand)
            hand = []

    print(len(pockets) if not hand else len(pockets) + 1)

if __name__ == '__main__':
    main()

n=int(input())
l=list(map(int,input().split()))
x=[]
for i in range(n):
    p=l.count(i)
    x.append(p)
z=max(x)
print(z)

x = int(input())
y = list(map(int , input().split()))
y.sort()
win = 0

for c in range (101):
    if y.count(c) > win:
        win = c

print(win)
print(y.count(win+1))

n=int(input())
a=list(map(int,input().split()))
a.sort()
x=a[0]
b=[]
y=0
for i in range(1,n):
    if x!=a[i]:
        if y>0:
            b.append(y)
        x = a[i]
        y=0
    else:
        y=y+1
if b==[]:
    print(n)
else:
    print(max(b)+1)

import sys

if __name__ == "__main__":

    n = int(sys.stdin.readline())
    l = sys.stdin.readline().strip('\n').split(' ')

    l.sort()
    count = 1
    aux = 1

    for j in range(1,n):
        if l[j-1] == l[j]:
            count+=1

            if count>aux:
                aux = count
            continue

        else:
            count = 0

    print (aux)

n = int(input())
a = []
ainp = raw_input()
print(ainp)
ai = ainp.split(" ")
for i in range(0,n):
	a.append(int(ai[i]))

ans = 0
for i in range(0,n):
	count = 0
	for j in range(0,n):
		if a[i] == a[j] :
			count+=1

	if count > ans:
		ans = count

print(ans)

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

b = set(a)

print(len(a) - len(b) if len(a) - len(b) > 0 else 1)

from sys import exit
n = int(input())
s = list(map(int, input().split()))
ans = 0
for i in range(101):
    ans = max(ans, s.count(i))

from collections import OrderedDict

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

def group_list(lst):
    res = [(el, lst.count(el)) for el in lst]
    return list(OrderedDict(res).items())

z = []
for x,y in group_list(y):
    z.append(y)

print(z[-1])

class pockets:

    def __init__(self,m):
        self.m=[]
        self.m.append(m)

c=int(input())
val=[]
p=1
val=list(map(int,input().strip().split(" ")))
#for i in range(c):
 #   val.append(int(input()))

l=[]

for i in range(c):
	if (len(l)<1):
	    l.append(pockets(val[i]))
	    print("first coin",val[i]," added and number of pockets=",p,"\n")
	else:
		for j in range (len(l)):
			added=0
			if val[i] not in l[j].m:
				l[j].m.append(val[i])
				print("new coin",val[i]," added in old pocketand number of pockets=",p,"\n")
				added=1
				break
			else:
				continue
		if (added==0):
			l.append(pockets(val[i]))
			p=p+1
			print("new coin",val[i]," added in new pocketand number of pockets=",p,"\n")
			#break

print(p)

n=int(input())
a=list(map(int,input().split()))
a.sort()
b=[]
c=[1]
for i in range(len(a)-1):
    if a[i]!=a[i+1]:
        b.append(i+1)
for x in range(1,len(b)):
    c.append(b[x]-b[x-1])
print(max(c))

#http://codeforces.com/contest/1003/problem/0
n=int(input())
c=list(map(int,input().split()))
A=list(set(c))
if len(A)==1 :
    ans=1
if len(A)>=2 and len(A)!=len(c):
    ans=2
print(ans)

n = int(input())
a = list(map(int,input().split()))
k = 0
for i in a:
    k += 1
print(k)
c = set(a)
b = 0
for i in c:
    b += 1
print(b)
j = k - b
print(j + 1)


You are given a string s consisting of n lowercase Latin letters. You have to type this string using your keyboard.Initially, you have an empty string. Until you type the whole string, you may perform the following operation:  add a character to the end of the string. Besides, at most once you may perform one additional operation: copy the string and append it to itself.For example, if you have to type string abcabca, you can type it in 7 operations if you type all the characters one by one. However, you can type it in 5 operations if you type the string abc first and then copy it and type the last character.If you have to type string aaaaaaaaa, the best option is to type 4 characters one by one, then copy the string, and then type the remaining character.Print the minimum number of operations you need to type the given string.

The first line of the input containing only one integer number n (1 ≤ n ≤ 100) — the length of the string you have to type. The second line containing the string s consisting of n lowercase Latin letters.

Print one integer number — the minimum number of operations you need to type the given string.

NoteThe first test described in the problem statement.In the second test you can only type all the characters one by one.

length = input()
text = input()
len_dec = 0
conseq_str = str()
match_length = 0
match_found = False
try:
    idx = 0
    length = 1
    while idx < len(text):
        conseq_str = text[:idx+1]
        poss_match = text[idx+1:idx+length+1]
        if (conseq_str == poss_match):
            match_length = length
            match_found = True
        length += 1
        idx += 1
    if(match_found):
        total_moves = match_length + 1 + (len(text)-2*match_length)
    else:
        total_moves = len(text)
    print (total_moves)
except:
    print (0)

#------------------------template--------------------------#
import os
import sys
# from math import *
from collections import *
# from fractions import *
# from heapq import*
from bisect import *
from io import BytesIO, IOBase
def vsInput():
    sys.stdin = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
ALPHA='abcdefghijklmnopqrstuvwxyz/'
M=1000000007
EPS=1e-6
def Ceil(a,b): return a//b+int(a%b>0)
def value():return tuple(map(int,input().split()))
def array():return [int(i) for i in input().split()]
def Int():return int(input())
def Str():return input()
def arrayS():return [i for i in input().split()]

#-------------------------code---------------------------#
# vsInput()

n=Int()
s=input()

ans=0
ok=True

while(len(s)):
    ans+=1
    if(len(s)%2): s=s[:-1]
    else:
        k=len(s)//2
        if(s[:k]==s[k:] and ok):
            s=s[:k]
            ok=False
        else: s=s[:-1]

print(ans)

n=int(input());s=input()
ans=n
for i in range(1,n//2+1):
    if s[0:i]==s[i:i*2]:
        ans=min(ans,n-i+1)
print(ans)

n=int(input())
s=input()
mid=n//2
while s[:mid]!=s[mid:2*mid] and mid!=0:
    mid-=1
print(min(n,n-mid+1))

def doshit(st,steps,ct):
  global n;global s
  #print("  "*steps,st,steps)
  if st==s:
    return steps
  if len(st)>n//2:
    return steps+(n-len(st))
  else:
    x=1<<63
    if st==s[len(st):2*len(st)] and ct==0:
      t=2*st
      x=min(doshit(t,steps+1,1),x)
    t1=st+s[len(st)]
    x=min(x,doshit(t1,steps+1,ct))
    return x

n=int(input())
s=input()
print(doshit(s[0],1,0))

n, s = int(input()), input()
e = 0
for i in range(1,n//2+1):
    if s[:i]==s[i:i*2]: e=i
print(n-max(e-1,0))

n=int(input())
s=input()
c=""
mini=len(s)
for i in range(len(s)//2):
    c+=s[i]
    if(c==s[i+1:i+1+len(c)]):
        if(mini>i+2+len(s)-2*(i+1)):
            mini=i+2+len(s)-2*(i+1)
print (mini)

n = int(input())
s = input()
mini = n
for i in range(int(n/2)+1):
    left = s[0:i]
    length = len(s[0:i])
    right = s[i:i+length]
    if left==right:
        mini = min(mini,(n-length+1))
print (mini)

n = input()
n = int(n)
str = input()

indicator = 0

Max = 0

for i in range(int(n/2)):
    s1 = str[:i + 1]
    s2 = str[i+1:2*i + 2]

    if s1 == s2:
        Max = len(s1)

if Max > 0:
    print(n - Max + 1)
else:
    print(n)

n = int(input())
s = input()
z = [0] * n
for i in range(n):
    if 2 * i <= n:
        if s[:i] == s[i:2 * i]:
            z[i] = i
if max(z) != 0:
    print(n - max(z) + 1)
else:
    print(n)

N = int(input())
s = input().strip()
minus=0
for i in range(len(s)):
    if s[:i+1]==s[i+1:i*2+2]:
       minus= i
print(len(s)-minus)

n = int(input())
s= input()
c=0
for i in range(int(n/2),0,-1):
     if(s[0:i]==s[i:2*i]):
          print(n-i+1)
          c=1
          break
if(c==0): print(n)

n=int(input())
s=input()
m=1
for i in range(1,n//2+1):
    if s[:i]==s[i:2*i]:
        m=i
print(n-m+1)

n=input()
s=raw_input()
a=n
for i in range(1,n/2+1):
    if s[:i]==s[i:i*2]:
        a=min(a,1+n-i)
print a

import sys

n = int(input())
s = input()
ans = 0

for i in range(1, n):
    if s[:i] == s[i:i+i]:
        ans = max(ans, i-1)

print(n - ans)

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

m = ''
for i in range(1, len(s)):
    if s[0:i] == s[i:i * 2] and len(s[0:i]) > len(m):
        m = s[0:i]

if len(m) == 0:
    print(len(s))
else:
    print(len(s) - len(m) + 1)

n=int(input())
x=0
s=input()
for i in range(1,n//2+1):
    if s[:i]==s[i:i*2]: x=i
print(n-max(x-1,0))

n = int(input())
s = input()
d = ""
Max = len(s)
count = Max
for i in range(len(s)//2):
    d = d + s[i]
    if s[i+1:].find(d) == 0:
        count = len(s) - len(d) + 1
    if count < Max :
        Max = count
print(count)

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

for L in range(len(s) // 2, 1, -1):
    if s[:L] == s[L:2*L]:
        print(n - L + 1)
        break
else:
    print(n)

n=input()
x=0
s=raw_input()
for i in range(1,n//2+1):
    if s[:i]==s[i:i*2]: x=i
print(n-max(x-1,0))

# cook your dish here
n = int(input())
str = input()
max1= 0

for i in range(1,int(n/2)+1):
    if(str[:i] == str[i:i+i]):
        max1 = max(max1,i)
if(max1 > 0):
    max1 = max1 - 1
print(n - max1)

n = int(input())
s = input()
ans = n
for p in range(1, n):
    if 2 * p > n:
        break
    if s[:p] + s[:p] == s[:(2 * p)]:
        ans = min(ans, p + 1 + n - 2 * p)
print(ans)

n = int(input())
s = input()
ans = n
for i in range(n // 2 + 1):
    if s[:i] == s[i:2*i]:
        ans = min(ans, n - i + 1)
print(ans)

n = int(input())
s = input()
for l in range(n // 2, -1, -1):
    if s[:l] == s[l:2 * l]:
        print(n - max(0, l - 1))
        break

n=int(input())
s=input()
indcopy=0
for i in range(1,n//2+1):
    if s[:i]==s[i:i*2]: indcopy=i
print(min(n, n-indcopy+1))

n = int(input())
s = input()
d = ""
Max = len(s)
count = Max
for i in range(len(s)):
    d = d + s[i]
    if s[i+1:].find(d) == 0:
        count = len(s) - len(d) + 1
    if count < Max :
        Max = count
print(count)

# -*- coding: utf-8 -*-
"""
Created on Sun Apr  1 15:33:47 2018

@author: Harsh Pathak
"""

# -*- coding: utf-8 -*-
"""
Created on Sun Apr  1 14:17:29 2018

@author: Harsh Pathak
"""
def find_similarities(string):
    flag = 0
    for i in range(len(string)):
        for j in range(i+1,len(string)):
            if string[i]==string[j]:
                flag = 1
    return flag
def find_largest_occurence(string):
    char_list = []
    len_list = []
    for i in range(1,len(string)):
        stored_str = string[0:i]
        j=i
        check_str = string[j:j+i]
        if check_str == stored_str:
            char_list.append(check_str)
            len_list.append(i)
    main_dict = dict(zip(len_list,char_list))
    return main_dict
len_string = int(input())
string = input()
flag = find_similarities(string)
if flag == 0:
    print (len_string)
else:
    val_dict = find_largest_occurence(string)
    if bool(val_dict)==True:
        max_val = max(val_dict,key=val_dict.get)
        print (len_string-max_val+1)
    else:
        print (len_string)

#!/bin/env python
# -*- encoding: UTF-8 -*-

def mp():
    return map(int,str(raw_input()).split())

n = int(raw_input())
s = str(raw_input())

ans = n
for i in range(n/2):
    if s[:i+1] == s[i+1:2*i+2]:
        ans = min(ans, i + 1 + 1 + n - 2*i -2)
print ans

def string_count (string='name', idx=0, num=100, end=100):
    flag = True
    for i in range (idx, end+1):
        if i+num >= len(string):
            flag = False; break
        if string[i] == string[i+num]:
            flag = True
        else:
            flag = False
            break
    return flag

x = int(input())
s = str(input())
max = 0

#for i in range (0, x-1):
z = 1
u = 0
while 1:
  #u = 0
  v = s.find(s[0],z)
  if v < 0: break
  tmp = v - u
  r = string_count(s, 1, tmp, v-1)
  if tmp > max and r==True:
      max = tmp
  z = v+1

if max > 0: max -= 1

print (x - max)

n=int(input());s=input()
ans=n
for i in range(1,n//2+1):
    if s[0:i]==s[i:i*2]:
        ans=min(ans,n-i+1)
print(ans)

n = int(input())
s = input()
d = ""
Max = len(s)
count = Max
for i in range(len(s)):
    d = d + s[i]
    if s[i+1:].find(d) == 0:
        count = len(s) - len(d) + 1
    if count < Max :
        Max = count
print(Max)

n=int(input())
a=input()
ct=0
h=1
p=0
t=0
m=int(n/2)
while 1:
    if a[0:m]==a[m:2*m]:
        ct=n-m+1
        break
    if m==1:
        ct=n
        break
    m-=1
if n==1:
    print(1)
else:
    print(ct)

n = int(input())

A = input()

best_result = n

for i in range(1, n // 2 + 1):
    if A[0:i] == A[i:2 * i]:
        best_result = i + 1 + n - 2 * i

print(best_result)

n = int(input())
s = input()
i = n-1
moves = 0
while(i>=0):
	# print(i)
	c = 1
	if((n-i)>=i and i>0):
		for j in range(i):
			if(s[j] != s[i+j]):
				c = 0
	else:
		c = 0
	if(c == 0):
		moves += 1
		i-=1
	else:
		moves += 1
		i-=i
print(moves)

n = int(input())
s = input()
z = [0] * n
for i in range(n):
    if 2 * i <= n:
        if s[:i] == s[i:2 * i]:
            z[i] = i
if max(z) != 0:
    print(n - max(z) + 1)
else:
    print(n)

n=input();txt=raw_input();i=1
for i in xrange(n/2,0,-1):
  if txt[:i]*2==txt[:i*2]:
    break
print (i+1)+(n-i*2)

n = int(input())
s = input()
ans = n
for l in range(1, n // 2 + 1):
    if s[:l] == s[l:2*l]:
        ans = min(ans, n - l + 1)

print(ans)

n = int(raw_input().strip())
s = list(raw_input().strip())
maxequals = 0
for i in range(n):
    if(((2 * (i  + 1)) <= n) and (s[0 : i + 1] == s[i + 1 : 2 * (i + 1)])):
        maxequals = i
print len(s) - maxequals

import re
print input()+1-len(re.match(r'(.*)\1',raw_input()).group(1)or[0])

n = int(input())
s = input()
for i in range(n // 2, -1, -1):
    if (s[:i] == s[i:2 * i]):
        break
print(min(n, n + 1 - i))

n = int(raw_input())
s = raw_input()

best = n
for l in range(1, n / 2 + 1):
    if 2 * l > n: break
    if s[:l] == s[l:2*l]:
        best = min(best, l + 1 + n - 2 * l)

print best

n = int(input())
word = input()

tempPatt = ""

count = 1
while count < n:
    pattern = word[0:count]
    pos = word.find(pattern)
    pos2 = word.find(pattern,pos+len(pattern))
    if pos2 == pos+len(pattern):
        tempPatt = pattern

    count += 1

if tempPatt != "":
    print(len(word) - len(tempPatt) + 1)
else:
 print(n)

n = int(input())
s = input()
operations = n
for i in reversed(range(1,n // 2 + 1)):
  if s[:i] == s[i:2*i]:
      operations = n - i + 1
      break
print(operations)

n = int(input())
s = input()
d = ""
Max = len(s)
count = Max
for i in range(len(s)):
    d = d + s[i]
    if s[i+1:].find(d) == 0:
        count = len(s) - len(d) + 1
    if count < Max :
        Max = count
print(count)

n=int(raw_input())
st=raw_input()
a=n
for i in xrange(1,n):
	p=st[:i]
	if st.startswith(p*2):
		a=n-i+1
print a

from sys import stdin, stdout
ti = lambda : stdin.readline().strip()
ma = lambda fxn, ti : map(fxn, ti.split())
ol = lambda arr : stdout.write(' '.join(str(i) for i in arr) + '\n')
os = lambda i : stdout.write(str(i) + '\n')
olws = lambda arr : stdout.write(''.join(str(i) for i in arr) + '\n')

n = int(ti())
s = ti()

if n == 1:
	os(1)
	exit()
if n == 2:
	os(2)
	exit()

ptr = n
ans = n
while ptr>1:
	if s[:ptr-1] == s[ptr-1: 2*(ptr-1)]:
		ans -= ptr-1
		os(ans+1)
		exit()
	ptr -= 1
os(n)

n = int(input())
s=  input()
mx =0
i = 0
for j in range(i+1,n):
     if s[i:j] == s[j: (j+(j-i))%(n+1)]:
          mx = max(mx,(j-i))
if mx ==0:
     print(n)
else:
     print(n - mx+1)

n = int(input())
s = str(input())
x = 0
for i in range(n):
    if s[:i] == s[i:i+i]:
        x = max(i,x)
if x:
    print(n-x+1)
else:
    print(n)

# itne me hi thakk gaye?
n = int(input())
s = input()
to_check = ''
mini = len(s)
for i in range(n):
    to_check += s[i]
    next = s.find(to_check, i+1)
    # print(to_check, next, i)
    if next == -1:
        continue
    elif next == i+1:
        # if next == i+1:
        typing = n - len(to_check) + 1
        mini = min(mini, typing)
print(mini)

n=int(input())
s=input()
m=1
for i in range(1,n//2+1):
    if s[:i]==s[i:2*i]:
        m=i
print(n-m+1)

n = int(input())
st = input()

ans = 0
mid = n // 2
while mid > 0:
	if st[:mid] == st[mid: mid * 2]:
		ans = mid + 1
		break
	else:
		mid -= 1

ans += n - mid * 2
print(ans)

n = int(raw_input())
s = raw_input()
i = 0
res = n
for i in range(1, n):
    ss = s[:i]
    if len(ss) * 2 > n:
        break
    if ss == s[i:i+i]:
        res = i + 1 + n - 2 * i
print res

n = int(input())
s = input()
for i in range(n // 2, -1, -1):
    if s[:i] == s[i: 2 * i]:
        print(min(n, n - i + 1))
        exit()

n=int(raw_input())
s=raw_input()
res=0
maxcool=0
for i in range(2,n/2+1):
    if s[:i]*2==s[:2*i]:
        maxcool=i
res=n
if maxcool>1:
    res-=maxcool-1
print res

import sys

n = int(input())
s = input()
ans = 0

for i in range(1, n):
    if s[:i] == s[i:i+i]:
        ans = max(ans, i-1)

print(n - ans)

n = int(input())
a = input()
x = 0
for i in range(n//2, 1, -1):
    if a[0:i] == a[i:(i+i)]:
        x = i-1
        break
print(n-x)

n=int(input())
x=0
s=input()
for i in range(1,n//2+1):
    if s[:i]==s[i:i*2]: x=i
print(n-max(x-1,0))

import sys,math
n=int(input())
s=input()
ans=0
i=n-1
flag=True
while(i>=0):
    if i%2==1 and s[:i//2+1]==s[i//2+1:i+1] and flag:
        ans+=1
        i//=2
        flag=False
    else:
        i-=1
        ans+=1
print(ans)

n = int(input())
typestr = input()
slen = len(typestr)

ans = slen

for k in range(slen):
    if k+k-1<slen:
        if typestr[0:k] == typestr[k:k*2]:
            ans = min(ans,slen-k+1)
    else:
        break

print(ans)

n = int(input())
s = input()
index = 0
for i in range(n):
    for j in range(n - i + 1):
        s1 = s[:i]
        s2 = s[i:i + j]
        if s1 == s2:
            index = i
op = index + 1
op += n - 2*index
if index == 0:
    op -= 1
print(op)

n=int(input())
a=input()
ct=0
h=1
p=0
t=0
m=int(n/2)
while 1:
    if a[0:m]==a[m:2*m]:
        ct=n-m+1
        break
    if m==1:
        ct=n
        break
    m-=1
if n==1:
    print(1)
else:
    print(ct)

n = int(input())
s = str(input())
if len(s) % 2 == 0:
    l = len(s) // 2
    h = len(s) // 2  # + l
    count = 1
    i = 0
    while l > 1 and h > 1:
        if s[:l] == s[l:l + h]:
            count = l
            break
        else:
            l = (len(s) - i) // 2
            h = (len(s) - i) // 2
        i += 2
    copy = count + 1
    left = n - 2 * count
    print(left + copy)
else:
    s = s[:len(s) - 1]
    l = len(s) // 2
    h = len(s) // 2  # + l
    count = 1
    i = 0
    while l > 1 and h > 1:
        if s[:l] == s[l:l + h]:
            count = l
            break
        else:
            l = (len(s) - i) // 2
            h = (len(s) - i) // 2
        i += 2
    copy = count + 1
    left = n - 2 * count
    print(left + copy)

#empty str
#add 1 character to end until you get whole string
#or
#only once
#append the string to itself
#print minimum operations needed to print given str
#FIND LONGEST REPEATING HALF STRING
#gstr = 'afdfasdf....'
#str = ""
#while str!=gstr:
#	str+=
#
#

n = int(raw_input())
s = raw_input()
rpg = ""
ci = None
for i in xrange(2,(n/2)+1):
	#print s[:i]*2
	#print s[:(2*i)+1]
	if s[:i]*2  == s[:2*i]:
		rpg = s[:i]
		ci = i

if rpg!="":
	opc = len(rpg) + 1 + len(s[2*ci:])
else:
	opc = len(s)

print opc

def main():
    n = int(input())
    line = input()
    ans = 0
    for i in range(50):
        if line[:i + 1] == line[i + 1:2 * (i + 1)]:
            ans = i
    print(n - ans)

main()

input()
inputString = input()
ans = 0
for i in range(len(inputString) - 1, -1, -1):
    ans += 1
    #print(ans)
    if i % 2 == 0:
        continue
    if(inputString[: (i + 1) // 2] == inputString[(i + 1) // 2 : i + 1]):
        #print(inputString[: (i + 1) // 2] + " " + inputString[(i + 1) // 2 : i + 1])
        ans += i // 2 + 1
        break

print(ans)
exit()

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

    string = input()

    idx, result, consumed = len(string), 0, False

    while idx > 0:
        if idx % 2 == 0 and string[:idx // 2] == string[idx // 2:idx] and not consumed:
            idx //= 2
            consumed = True
        else:
            idx -= 1
        result += 1

    print(result)

if __name__ == "__main__":
    main()

n = int(input())
s = input()
l = int(n//2)
ans = n
for i in range(l,-1,-1):
    if(s[:i]==s[i:2*i]):
        ans = min(ans,n-i+1)
print(ans)

n = int(input())
s = input()
d = ""
Max = len(s)
count = Max
for i in range(len(s)):
    d = d + s[i]
    if s[i+1:].find(d) == 0:
        count = len(s) - len(d) + 1
    if count < Max :
        Max = count
print(Max)

n=int(input())
s=input()
ans=n
for i in range(1,n):
    if(2*i>n):
        break
    if(s[:i]+s[:i]==s[:2*i]):
        ans=min(ans,n+1-i)
print(ans)

n = int(input())
s = input()
ans = n
for i in range(n // 2 + 1):
    if s[:i] == s[i:2*i]:
        ans = min(ans, n - i + 1)
print(ans)

""" just need to count substring from indx 0 to n/2 not from any i index. will be only one substring or dont hav any though it may exist"""
while True:
	try:

		n = int(input())
		s = input()
		res, cunt, i = n, 0, 1
		while i<= int(n/2):
			j, k = 0, i
			#print(j,k)
			while  j<i:
				if s[j] != s[k]:break
				if j == i-1:
					cunt = i+1
					cunt += n - 2*i
					res = min(res, cunt)
				j+=1
				k+=1
			i+=1
		print(res)
	except EOFError:
		break

n = int(input())
st = input()
data = []
if n > 3:
    for i in range(2, n):
        t = 2
        while i * t <= n and st[0:i] == st[i:i * t]:
            t += 1
        data.append((t - 2, i))
    mx1 = max(data, key=lambda x: (x[0], x[1]))[1]
    mx2 = max(data, key=lambda x: (x[0], x[1]))[0]
    print(mx1 + mx2 + (n - mx1 * mx2 - mx1))
else:
    print(n)

n = int(raw_input())
strng = raw_input()

num_operations = 0
i = len(strng)
while i > 0:
    if i % 2 == 0 and strng[:i / 2] == strng[i / 2:i]:
        num_operations += 1
        num_operations += i / 2
        break
    num_operations += 1
    i -= 1

print num_operations

n, s = int(input()), input()
e = 0
for i in range(1,n//2+1):
    if s[:i]==s[i:i*2]: e=i
print(n-max(e-1,0))

n =int(input())
string =input()
maxstr =''

for i in range(1,len(string)):
    substr =string[:i]
    remstr =string[i:]
    if len(substr) > len(remstr):
        break
    same =1
    for i in range(len(substr)):
        if substr[i] != remstr[i]:
            same =0
            break
    if not same:
        continue
    maxstr =substr
if maxstr != '':
    print(n-len(maxstr)+1)
    quit()
print(len(string))

n=int(input())
x=0
s=input()
for i in range(1,n//2+1):
    if s[:i]==s[i:i*2]: x=i
print(n-max(x-1,0))

n = input()
txt = str(raw_input())
pat = ''
wyn = n
wyn2 = 0
pat = txt[0]
for y in range(1, len(txt), +1):
    pat += txt[y]
    dl = 1
    wyn2 = 0
    while True:
        if y + len(pat) * dl <= len(txt):
            nn = y + 1 + (len(pat) * (dl - 1))
            nnn = y + len(pat) * dl
            temp_wyn = txt.count(pat, nn, nnn + 1)
            if temp_wyn == 1:
                wyn2 += 1
                dl += 1
                if len(pat) + wyn2 + (n - ((wyn2 + 1) * len(pat))) < wyn:
                    wyn = len(pat) + wyn2 + (n - ((wyn2 + 1) * len(pat)))
            break
        else:
            break
print wyn

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

for i in range(1,int(n/2)+1):
	if s[:i]==s[i:2*i] :
		ans=n-i+1
print(ans)

n = int(input())
s = input()
ans = 0
for i in range(1,n):
    a = s[:i]
    b = s[i:]
    if(len(a)>len(b)):
        break
    if(b[:len(a)]==a):
        ans = i
if(ans==0):
    print(n)
else:
    f_ans = ans+1+(n-2*ans)
    print(f_ans)

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

for L in range(n // 2, 1, -1):
    if s[:L] == s[L:2*L]:
        print(n - L + 1)
        break
else:
    print(n)

n = int(input())
s= input()
c=0
for i in range(int(n/2),0,-1):
     if(s[0:i]==s[i:2*i]):
          print(n-i+1)
          c=1
          break
if(c==0): print(n)

import re
n = int(input()) ;s = input()
t = re.sub(r'^(.+)\1.*', r'\1', s)
print(t)
if len(t) == len(s):
	print(len(s))
else:
	print(len(s) - len(t) + 1)

number=int(input())
string=input()
str=string[0]
index=1
str_o=1
while index < number:
	if str[:index]==string[index:2*(index)]:
		str_o  += 1
		index *= 2
		str += str
	else:
		str_o += 1
		index += 1
		str+=string[index - 1]
f = False
c = string[0]
for i in range(number):
	if c != string[i]:
		f = True
		break
if f == False:
	str_o = 0
	wk1 = number
	while wk1 > 0:
		if wk1 % 2 == 1:
			str_o += 1
			wk1 -= 1
		if wk1 == 0:
			break
		wk1 = wk1 // 2
		str_o += 1
print(str_o)

def solve(i):
    if len(word) == i:
        return 0

    a = 10**9
    if i*2 <= len(word) and word[:i] == word[i:i*2]:
        a = solve(i*2)
    return min(1+a, 1+solve(i+1))

input()
word = input()
print (1+solve(1))

n=int(input())
ch=input()
s=0
i=0
if ch.count(ch[0])==n:

    print((n+1)//2)
else:
    while i<n:
        for j in range(i+1,n+1):
            a=ch[j+1:n].find(ch[i:j])
            if a>=0:
                s+=1+a-i
                i+=a+j-i
                break
            elif j==n:
                s+=n-i
                i=n

    print(s)

from sys import stdin, stdout
ti = lambda : stdin.readline().strip()
ma = lambda fxn, ti : map(fxn, ti.split())
ol = lambda arr : stdout.write(' '.join(str(i) for i in arr) + '\n')
os = lambda i : stdout.write(str(i) + '\n')
olws = lambda arr : stdout.write(''.join(str(i) for i in arr) + '\n')

n = int(ti())
s = ti()

if n == 1:
	os(1)
	exit()
if n == 2:
	os(2)
	exit()

news = "" + s[n-1]
sl = 1
ptr = n-2
ans = 1
done = False
while ptr != 0:
	if s[ptr] != s[0]:
		news = s[ptr] + news
		sl += 1
		ptr -= 1
	else:
		if s[:ptr] == s[ptr:ptr+ptr] and not done:
			news = s[:ptr] + news
			ptr -= sl
			sl += sl
			done = True
		else:
			news = s[ptr] + news
			sl += 1
			ptr -= 1
	ans += 1

os(ans+1)

n = int(input())
s = input()
changed = False
operations = 0
new_s = ''
for i in range(n):
    if len(new_s) == n:
        break
    new_s += s[i]
    operations += 1
    if i < n // 2 and not changed:
        if new_s == s[i+1:2*i+2]:
            new_s += s[i+1:2*i+2]
            operations += 1
            changed = True
print(operations)

n=input();txt=raw_input()
for i in xrange(n/2,0,-1):
  if txt[:i]*(n/i)==txt[:-(n%i)]:
    break
print i+(n/i-1)+(n%i)

def solve(s):
	res = s[0]
	ans = 0
	doubles = []
	for i in range(len(s) / 2 + 1):
		if s[:i] * 2 == s[:i*2]:
			doubles.append(s[:i])
	while True:
		if len(res) >= len(s):
			break
		#print(res)
		if res + res == s[:(len(res) * 2)]:
			ans += 1
			#doubles.append(res)
			res *= 2
		else:
			ans += 1
			res += s[len(res)]
	#print(doubles)
	if len(doubles) > 0:
		ans = len(max(doubles, key=len)) + (len(s) - (len(max(doubles, key=len)) * 2))
	return res, ans + 1

n = int(raw_input().strip())
s = raw_input().strip()
print(solve(s)[-1])

from sys import stdin, stdout
ti = lambda : stdin.readline().strip()
ma = lambda fxn, ti : map(fxn, ti.split())
ol = lambda arr : stdout.write(' '.join(str(i) for i in arr) + '\n')
os = lambda i : stdout.write(str(i) + '\n')
olws = lambda arr : stdout.write(''.join(str(i) for i in arr) + '\n')

n = int(ti())
s = ti()

news = "" + s[0]
ans = 1
if n == 1:
	os(ans)
	exit()
if n == 2:
	os(2)
	exit()

sl = 1
ptr1 = 0
ptr2 = 1
while ptr2 != n:
	if s[ptr1] != s[ptr2]:
		news += s[ptr2]
		ptr2 += 1
		sl += 1
	else:
		if ptr2+sl < n+1 and news == s[ptr2:ptr2+sl]:
			news += news
			ptr2 += sl
			sl += sl
		else:
			news += s[ptr2]
			ptr2 += 1
			sl += 1
	ans += 1

os(ans)

n = int(input())
s = input()
i = 0
moves = 0
while(i<n):
	# print(i)
	c = 1
	if((n-i)>=i and i>0):
		for j in range(i):
			if(s[j] != s[i+j]):
				c = 0
	else:
		c = 0
	if(c == 0):
		moves += 1
		i+=1
	else:
		moves += 1
		i+=i
print(moves)

#!/bin/env python
# -*- encoding: UTF-8 -*-

def mp():
    return map(int,str(raw_input()).split())

n = mp()
s = str(raw_input())

def find(s, res):
    if s in res:
        return res[s]
    ans = 10000000
    for i in range(len(s) - 1):
        l = s[0: i+1]
        r = s[i+1:]
        lw = find(l, res)
        rw = find(r, res)
        cur = lw + rw
        if l == r:
            cur = lw + 1
        ans = min(ans, cur)
    if len(s) == 1:
        ans = 1
    res[s] = ans
    #print s, ans, res
    return ans

res = {}
ans = find(s, res)
print ans

x = int(input())
y = input()

def operations(x):
    if x == 0:
        return 0
    if x % 2 == 0:
        part = int(x/2)
        if y[0:part] == y[part:2*part]:
            return part
        else:
            return 1 + operations(x-1)
    else:
        return 1 + operations(x-1)

print(operations(x))

n = int(raw_input())
s = raw_input()

best = n
for l in range(1, (n + 1) / 2):
    if s[:l] == s[l:2*l]:
        best = min(best, l + 1 + n - 2 * l)

print best

n = int(input())
s = input()
ans = 0
while s:
    if len(s) % 2 == 1:
        ans += 1
        s = s[:len(s) - 1]
    else:
        if s[:len(s) // 2] == s[len(s) // 2 + 1:]:
            ans += 1
            s = s[:len(s) // 2]
        else:
            ans += 1
            s = s[:len(s) - 1]
print(ans)

n = int(input())
lst = list(input())
lst1 = []
lst2 = []
s=0
for i in range(n):
    if lst[i] not in lst1:
        lst1.append(lst[i])
    elif lst[i] not in lst2:
        lst2.append(lst[i])
if lst1==lst2:
    s+=len(lst1)+1
    s+=n-len(lst1)*2
else:
    s+=n
print(s)

def check(sstring):
	for i in range(len(sstring)//2+1):
		# print(string[i])
		if sstring[i]!=sstring[(len(sstring)//2)+i]:
			return False
	return True

def main():
	n = int(input())
	string = str(input())
	mx = -1
	for i in range(2,len(string),2):
		t = string[:i+1]
		if check(t):
			mx = max(mx,i//2)
	if mx==-1:
		print(len(string))
	else:

		print(len(string)-mx+1)

main()

import math as m

l = int(input())
s = input()

#print(l/2)

i=m.trunc(l/2)
t = 0
while i > 1:
    #print(s[0:i] + "\t" + s[i:2*i])
    if s[0:i] == s[i+1:2*i+1]:
        t = i;
        #print("!" + str(t))
        break;
    i -= 1

#print(t)
print(l-t)

from sys import stdin, stdout
ti = lambda : stdin.readline().strip()
ma = lambda fxn, ti : map(fxn, ti.split())
ol = lambda arr : stdout.write(' '.join(str(i) for i in arr) + '\n')
os = lambda i : stdout.write(str(i) + '\n')
olws = lambda arr : stdout.write(''.join(str(i) for i in arr) + '\n')

n = int(ti())
s = ti()

if n == 1:
	os(1)
	exit()
if n == 2:
	os(2)
	exit()

news = "" + s[n-1]
sl = 1
ptr = n-2
ans = 1
while ptr != 0:
	if s[ptr] != s[0]:
		news = s[ptr] + news
		sl += 1
		ptr -= 1
	else:
		if s[:ptr] == s[ptr:ptr+ptr]:
			news = s[:ptr] + news
			ptr -= sl
			sl += sl
		else:
			news = s[ptr] + news
			sl += 1
			ptr -= 1
	ans += 1

os(ans+1)

def fun(str):
    global count
    p = int(len(str)/2)
    if(len(str)<=3):
        count = count +len(str)
    elif(str[0:p] == str[p:]):
        count = count+1
        str = str[0:p]
        if(len(str)%2 != 0):
            count = count +1
            str = str[:-1]
        fun(str)
    else:
        count += 2
        str = str[:-2]
        fun(str)

n = int(input())
str = input()
count = 0
if(len(str)%2 == 0):
    fun(str)
    print(count)
else:
    count = count+1;
    str = str[:-1]
    fun(str)
    print(count)

n = int(raw_input())
s = raw_input()

best = n
for l in range(1, (n + 1) / 2):
    if s[:l] == s[l:2*l]:
        best = l + 1 + n - 2 * l

print best

number=int(input())
string=input()
str=string
index = number
str_o = 0
while index > 0:
	if index % 2 == 1:
		str_o += 1
		str = str[:-1]
		index -= 1
	elif str[0:index // 2] == str[index // 2: index]:
		str_o += 1
		str = str[0:index // 2]
		index = index // 2
	else:
		str_o += 1
		str = str[:-1]
		index -= 1

print(str_o)

n = int(input())
str = input()
max1 = 0
for i in range(n):
    count = 0
    t = 0
    val =  -1
    j = i +1
    while(j < n):

        max1 = max(max1,count)
        if(str[i + t] == str[j] and i+t != val):
            if(count == 0):
                val = j
            count = count + 1

            t = t + 1
            j += 1

        else:
            if(count == 0):
                j +=1
            val = -1
            count = 0
            t = 0
#print(max1)
if(max1 > 0):
    max1 = max1 - 1
print(n-max1)

n=int(input())
s=input()
ans=-1
for i in range(0,n//2+1):
    for j in range(i+1,n):
        if(s.count(s[i:j])>=2):
            ans=max(ans,j-i)
if(ans==-1):
    print(n)
else:
    print(n-ans+1)

n=int(input())
ch=input()
s=0
i=0
while i<n:
    for j in range(i+1,n+1):
        a=ch[j+1:n].find(ch[i:j])
        if a>=0:
            s+=1+a-i
            i+=a+j-i
            break
        elif j==n:
            s+=n-i
            i=n

print(s)

a = int(input())
b = input()
x = 0
for i in range(1, int(a/2)+1):
    if b[:i] == b[i:i+i]:
        x = i
print(a - x)

n=int(input())
ch=input()
s=0
i=0
while i<n:
    for j in range(i+1,n+1):
        a=ch[j+1:n].find(ch[i:j])
        if a>=0:
            s+=1+a-i
            i=j
            break
        elif j==n:
            s+=n-i
            i=n

print(s)

def solve(i):
    if len(word) == i:
        return 0

    a = 10**9
    if i*2 <= len(word) and word[:i] == word[i:i*2]:
        a = solve(i*2)
    return 1+min(a, solve(i+1))

input()
word = input()
print (1+solve(1))

a = int(input())
b = input()
x = 0
for i in range(1, int((a)/2)+1):
    if b[:i] == b[i:i+i]:
        x = i
print(a - x)

x=int(input())
y=input()
def gamd(st,x,z):
    if x>1:
        if x%2==0:
            if st[0:int(x/2)]==st[int(x/2) : ]:
                print(int(x/2)+1+z)
            else:
                gamd(st[0:x-2],x-2,z+2)
        else:
            st=st[:x-1]

            if st[0:int(x/2)]==st[int(x/2) : ]:

                print(int(x/2)+1+z+1)
            else:
                gamd(st[0:x-1],x-1,z+1)

    else:
        print(z)

gamd(y,x,0)

def solution(count, s):
    dup = 0
    for i in range(0, count, 2):
        if s[:i/2] == s[i/2:i]:
            dup = i/2
    if dup == 0:
        return count
    return count - dup + 1

if __name__ == '__main__':
    c = int(raw_input())
    s = raw_input()
    print(solution(c, s))

while True:
	try:
		def solution(n, s):
			i = 0
			ans = n
			while i <= n//2:
				i += 1;k = i;j = 0
				frq = 0
				while k < n and j < k and j< i:
					if s[j] != s[k]:
						j += 1
						frq = 0
						continue
					elif j == i-1 and s[j] == s[k]:
						frq += 1
						frq += n - (2*frq)
						ans = min(ans, frq +1)
					else:
						frq += 1
					k += 1
					j += 1
			print(ans)

		def read():
			n = int(input())
			s = input()
			solution(n, s)
		if __name__ == "__main__":
			read()
	except EOFError:
		break

n = int(input())
s = input()
z = [0] * n
for i in range(n):
    j = 0
    cnt = 0
    if i < (n + 1) // 2:
        while i + j < n and j < i:
            if s[i + j] == s[j]:
                cnt += 1
            else:
                break
            j += 1
        z[i] = cnt
if max(z) != 0:
    print(n - max(z) + 1)
else:
    print(n)

import math as m

l = int(input())
s = input()

i=m.trunc(l/2)+1
t = 0
while i > 0:
    if s[0:i] == s[i:2*i]:
        t = i;
        break;
    i -= 1

print(l-t)

x = int(input())
y = input()

def operations(x):
    if x == 0:
        return 0
    if x % 2 == 0:
        part = int(x/2)
        if y[0:part] == y[part:2*part]:
            return part
        else:
            return 1 + operations(x-1)
    else:
        return 1 + operations(x-1)

print(operations(x))

n = int(input())
s = input()
for k in range(n // 2, 0, -1):
  for i in range(n):
    if i + k + k > n:
      break
    if s[i:i + k] == s[i + k: i + k + k]:
      print(n - k + 1)
      exit(0)
print(n)

n = int(input())
s = input()
z = [0] * n
for i in range(n):
    j = 0
    cnt = 0
    if i <= (n + 1) // 2:
        while i + j < n and j < i:
            if s[i + j] == s[j]:
                cnt += 1
            j += 1
        z[i] = cnt
if max(z) != 0:
    print(n - max(z) + 1)
else:
    print(n)

n = int(input())
str = input()
max1 = 0
for i in range(n):
    count = 0
    t = 0
    for j in range(i+1,n):

        max1 = max(max1,count)
        if(str[i + t] == str[j]):
            count = count + 1
            t = t + 1

        else:

            count = 0
            t = 0
if(max1 > 0):
    max1 = max1 -1
print(n-max1)

n = int(input())
lst = list(input())
lst1 = []
lst2 = []
s=0
for i in range(n):
    if lst[i] not in lst1:
        lst1.append(lst[i])
    elif lst[i] not in lst2:
        lst2.append(lst[i])
if lst1==lst2 and len(lst1)==1 and len(lst2)==1:
    if n%2==0:
        s+=int(n/2+1)
    else:
        s+=int((n-1)/2+2)
elif lst1==lst2:
    s+=len(lst1)+1
    s+=n-len(lst1)*2
else:
    s+=n
print(s)

n = int(input().strip())
s = list(input().strip())
count = 0
while n > 0:
    if n % 2 == 1:
        count += 1
        n -= 1
    else:

        i = n // 2
        first = s[:i]
        second = s[i:n]
        copy = True
        for j in range(i):
            if first[j] != second[j]:
                copy = False
                n -= 2
                count += 2
                break
        if copy:
            count += 1
            n //= 2
print(count)

n = int(input())
lst = (input())
lst1 = []
lst2 = []
lst3 = []
s=0
#Counter(lst).most_common()
#print(lst)
for i in range(n):
    if lst[i] not in lst1:
        lst1.append(lst[i])
    elif lst[i] not in lst2:
        lst2.append(lst[i])
    else:
        lst3.append(lst[i])
#print(lst1,lst2,lst3)
if (lst3)==(lst1+lst2):
    s+=len(lst3)+1
elif lst1==lst2 and len(lst1)==1 and len(lst2)==1:
    if n%2==0:
        s+=int(n/2+1)
    elif n%2==1:
        s+=int((n-1)/2+2)
elif lst1==lst2:
    s+=len(lst1)+1+len(lst3)
elif len(lst3)==0 and len(lst2)!=0:
    s+=len(lst1)+1
else:
    s+=len(lst1)

print(s)

index = int(input())
str = input()
str_o = 0
while index > 0:
	if index % 2 == 1:
		index -= 1
	elif str[0:index // 2] == str[index // 2: index]:
		index = index // 2
	else:
		index -= 1
	str_o += 1
print(str_o)

import math as m

l = int(input())
s = input()

i=m.trunc(l/2)+1
t = 0
while i > 0:
    if s[0:i] == s[i+1:2*i+1]:
        t = i;
        break;
    i -= 1

print(l-t)

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

m = ''
for j in range(0, len(s) // 2):
    for i in range(1, len(s) // 2 + 1):
        if s[j:i] in s[i:] and len(s[j:i]) > len(m):
            m = s[j:i]

if len(m) == 0:
    print(len(s))
else:
    print(len(s) - len(m) + 1)

n=input()
s=raw_input()
ans=n
for i in range(n):
    if 2*i+1<=n:
        if s[:i+1]==s[i+1:2*i+1]:
            ans=n+1-i
print ans

n = int(input())
s = input()
ans = 0
while s:
    if len(s) % 2 == 1:
        ans += 1
        s = s[:len(s) - 1]
    else:
        if s[:len(s) // 2] == s[len(s) // 2 + 1:]:
            ans += 1
            s = s[:len(s) // 2]
        else:
            ans += 1
            s = s[:len(s) - 1]
print(ans)

n = int(input())
s = input()
z = [0] * n
for i in range(n):
    if i < (n + 1) // 2:
        if s[:i] == s[i:2 * i]:
            z[i] = i
if max(z) != 0:
    print(n - max(z) + 1)
else:
    print(n)

n=int(input())
ch=input()
s=0
d=0
f=n
c=''
M=0
while d<n:
    for j in range(n,d,-1):
        if ch[d:j]==c:
            s+=j-d
            M=j-d
            c+=ch[d:j]
            d=j
            break
    if j==d+1:
        s+=1
        c+=ch[d]
        d+=1

print(s-M+1)

n = int(input())
s = input()
cnt = -1
for i in range(n//2*2, 1, -2):
    if s[:i//2]==s[i//2:i]: cnt += i//2
print(n-max(0, cnt))

n=int(input())
a=input()
b=''
b+=a[0]
i=j=1
#print(2*i)
while i in range(n):
    try:
        if b[0:i]==a[i:(i+i)]:
            j+=1
            i+=(len(b))
            b+=(b[0:i])
            #print(b)
        else:
            b+=a[i]
            j+=1
            i+=1
            #print(b,i)
    except:
        b+=a[i]
        i+=1
        j+=1
print(j)

#------------------------template--------------------------#
import os
import sys
# from math import *
from collections import *
# from fractions import *
# from heapq import*
from bisect import *
from io import BytesIO, IOBase
def vsInput():
    sys.stdin = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
ALPHA='abcdefghijklmnopqrstuvwxyz/'
M=1000000007
EPS=1e-6
def Ceil(a,b): return a//b+int(a%b>0)
def value():return tuple(map(int,input().split()))
def array():return [int(i) for i in input().split()]
def Int():return int(input())
def Str():return input()
def arrayS():return [i for i in input().split()]

#-------------------------code---------------------------#
# vsInput()

n=Int()
s=input()

ans=0

while(len(s)):
    ans+=1
    if(len(s)%2): s=s[:-1]
    else:
        k=len(s)//2
        if(s[:k]==s[k:]): s=s[:k]
        else: s=s[:-1]

print(ans)

import re
print input()-len(re.match(r'(.*)\1',raw_input()).group(1))+1

n = int(input())
s = input()
i = 0
c = 0
mn = n
while i < n:
    if i % 2 == 0 and s[0: i // 2] == s[i//2:i]:
        c = i // 2
    i += 1
    mn = min(mn, n if c == 0 else n - c + 1)
print(mn)

n = input()
n = int(n)
str = input()

indicator = 0

Max = 0

for i in range(n - 1):
    temp = i + 1
    count = 0
    while temp < n and str[temp - i - 1] == str[temp] and temp - i - 1 < i + 1:
        count += 1
        temp += 1
    Max = max(Max, count)

if Max > 0:
    print(n - Max + 1)
else:
    print(n)

n = int(input())
s = input()
i = 0
c = 0
while i < n:
    if i % 2 == 0 and s[0: i // 2] == s[i//2:i]:
        c = i // 2
    i+= 1
print(n if c == 0 else n - c + 1)

n = int(input())
s = input()
i = 0
moves = 0
while(i<n):
	# print(i)
	c = 1
	if((n-i)>=i and i>0):
		for j in range(i):
			if(s[j] != s[i+j]):
				c = 0
	else:
		c = 0
	if(c == 0):
		moves += 1
		i+=1
	else:
		moves += 1
		i+=i
print(moves)

n=int(input())
s=input()
ans=-1
for i in range(1,n):
    if(2*i>n):
        break
    if(s[:i]+s[:i]==s[:2*i]):
        ans=max(ans,n+1-i)
if(ans==-1):
    print(n)
else:
    print(ans)

a = int(input())
b = input()
x = 0
for i in range(1, int(a/2)):
    if (b[0:i] == b[i:i+i]):
        x = i
print(a - x)

n=int(input())
s=input()
k=0

for i in reversed(range(1,int((n+1)/2))):
	if s[0:i]==s[i:2*i]:
		k=i
		break

print(min(n-k+1,n))

def iden(s1, s2):
	# print(s1, s2)
	if len(s2) < len(s1):
		return False
	for i in range(len(s1)):
		# print(i, "----")
		if not s1[i] == s2[i]:
			# print("HEEEYY")
			return False
	return True

n = input("")
s = input("")

cur = s[0]
i = 0
res = 1
while cur != s:
	i = len(cur)
	res += 1
	if iden(cur + cur, s):
		# print(cur + cur)
		cur = cur + cur
	else:
		cur += s[i]
	# print(cur)

print(res)

length = input()
text = input()
len_dec = 0
conseq_str = str()
match_length = 0
try:
    idx = 0
    length = 1
    while idx < len(text):
        print (length)
        conseq_str = text[:idx+1]
        print (conseq_str)
        poss_match = text[idx+1:idx+length+1]
        print (poss_match)
        if (conseq_str == poss_match):
            match_length = length
            match_found = True
        length += 1
        idx += 1
    total_moves = match_length + 1 + (len(text)-2*match_length)
    print (total_moves)
except:
    print (0)

numOfChar = int(input())
stringOfMov = input()
endpoint = int(numOfChar / 2)
maxlength = 0
if numOfChar>1:
    while (endpoint > 1):
        if stringOfMov[0:endpoint] == stringOfMov[endpoint:endpoint*2]:
            maxlength = endpoint
            endpoint = 0
        else:
            endpoint -= 1
            maxlength = endpoint
    if numOfChar == 2: print(numOfChar - maxlength)
    else: print(numOfChar - maxlength + 1)
else:
    print(1)

n = int(input())
s = input()
x = 1
for i in range(n//2, 0, -1):
    if (s[:i] == s[i:i*2]): x = i
print(n-(x-1))

n = int(input())
typestr = input()
slen = len(typestr)

ans = slen

for i in range(slen):
    for k in range(slen):
        if i+k-1 < slen or i+k+k-1<slen:
            if typestr[i:i+k] == typestr[i+k:i+2*k]:
                ans = min(ans,slen-k+1)
        else:
            break

print(ans)

length = input()
text = input()
len_dec = 0
conseq_str = str()
match_length = 0
try:
    idx = 0
    length = 1
    while idx < len(text):
        conseq_str = text[:idx+1]
        poss_match = text[idx+1:idx+length+1]
        if (conseq_str == poss_match):
            match_length = length
            match_found = True
        length += 1
        idx += 1
    total_moves = match_length + 1 + (len(text)-2*match_length)
    print (total_moves)
except:
    print (0)

import re
print input()-len(re.match(r'(.*)\1',raw_input()).group(1))+1

n=int(input())
ch=input()
s=0
i=0
if ch.count(ch[0])==n:

    print((n+1)//2)
else:
    while i<n:
        for j in range(i+1,n+1):
            a=ch[j+1:n].find(ch[i:j])
            if a>=0:
                s+=1+a-i
                i+=a+j-i
                break
            elif j==n:
                s+=n-i
                i=n

    print(s)

x = int(input())
y = input()

def operations(x):
    if x == 0:
        return 0
    if x % 2 == 0:
        part = int(x/2)
        if y[0:part] == y[part:2*part]:
            return part
        else:
            return 1 + operations(x-1)
    else:
        return 1 + operations(x-1)

print(operations(x))

s = input()

mn = len(s)

for i in range(1, len(s) // 2 + 1):
    if s[:i] == s[i:2 * i]:
        mn = len(s) - i + 1

print(mn)

n=int(input())
a=input()
ct=0
h=1
p=0
t=0
m=int(n/2)
while 1:
    if len(set(list(a[0:2*m])))==1 or n==1:
        if n==1:
            ct=1
            break
        ct=n-m+1
        break
    if a[0:m]==a[m:2*m]:
        if h==1:
            p=2*m
        h*=2
        t+=1
        if int(m)%2!=0:
            ct=n-p+int(p/h)+t
            break
        m=int(m/2)
        continue
    if m==1:
        ct=n-p+int(p/h)+t
        break
    m-=1
print(ct)

def solve(s):
	res = s[0]
	ans = 0
	while True:
		if len(res) >= len(s):
			break
		if res + res == s[:len(res) * 2]:
			res *= 2
		else:
			res += s[len(res)]
		ans += 1
	return res, ans + 1

n = int(raw_input().strip())
s = raw_input().strip()
print(solve(s)[-1])

n=input();txt=raw_input()
for i in xrange(n/2,0,-1):
  if txt[:i]*(n/i)==txt[:-(n%i)]:
    break
print i+(n/i-1)+(n%i)

import math as m

l = int(input())
s = input()

i=m.trunc(l/2)+1
t = 0
while i > 0:
    if s[0:i] == s[i:2*i]:
        t = i;
        break;
    i -= 1

print(l-t)

n = int(input())
s = list(input())
max_repeat = 0
for i in range(1,n//2+1):
    for j in range(0,n-2*i+1):
        left = s[j:j+i]
        right = s[j+i:j+i+i]
        # print(left,right)
        if(left==right):
            max_repeat = i
if(max_repeat!=0):
    print(1+n-max_repeat)
else:
    print(n)

n=int(raw_input())
st=raw_input()
a=0
for i in xrange(1,n):
	p=st[:i]
	if st.startswith(2*p):
		a=n-i+1
print a

n=int(input())
s=input()
i=1
curr=s[0]
match=''

while i<n:
    if s[i:2*i]==curr:
        i+=1
        match=curr
        curr+=s[i]
    else:
        curr+=s[i]
        i+=1
if len(match)!=0:
    print(n-len(match)+1)
else:
    print(n)

n = int(raw_input())
strng = raw_input()

num_operations = 0
i = len(strng)
while i > 0:
    if i % 2 == 0 and strng[:i / 2] == strng[i / 2:i]:
        print strng[:i / 2]
        print strng[i / 2:i]
        num_operations += 1
        num_operations += i / 2
        break
    num_operations += 1
    i -= 1
print num_operations

while True:
	try:
		def solution(n, s):
			i = 0
			ans = n
			t = n
			if t%2 == 0:
				t -= 1
			while i <= t//2:
				i += 1;k = i;j = 0
				frq = 0
				while k < n and j < k and j< i:
					if s[j] != s[k]:
						j += 1
						frq = 0
						continue
					elif j == i-1 and s[j] == s[k]:
						frq += 1
						frq += n - (2*frq)
						ans = min(ans, frq +1)
					else:
						frq += 1
					k += 1
					j += 1
			print(ans)

		def read():
			n = int(input())
			s = input()
			solution(n, s)
		if __name__ == "__main__":
			read()
	except EOFError:
		break

n=int(input())
ch=input()
s=0
d=0
f=n
c=''
M=0
if ch.count(ch[0])==n and n>1:
    if n%2==0:
        print((n//2)+1)
    else:
        print((n//2)+2)
else:
    while d<n:
        for j in range(n,d,-1):
            if ch[d:j]==c:
                s+=j-d
                M=j-d
                c+=ch[d:j]
                d=j
                break
        if j==d+1:
            s+=1
            c+=ch[d]
            d+=1
        print(s,d,M,c)

    if M==0:
        print(s)
    else:
        print(s-M+1)

input()
inputString = input()
ans = 0
for i in range(len(inputString) - 1, -1, -1):
    ans += 1
    #print(ans)
    if i % 2 == 0:
        continue
    if(inputString[: (i + 1) // 2] == inputString[(i + 1) // 2 : i + 1]):
        #print(inputString[: (i + 1) // 2] + " " + inputString[(i + 1) // 2 : i + 1])
        ans += i - 2
        break

print(ans)
exit()

import sys

l = int(input())
ip = input()

i = 0
highest = 0

while i < l:

	j = i+1

	while j <l:
		if ip[i:j] == ip[j:j*2] and (j-i)>highest:
			highest = j - i
		j+=1

	i +=1

if highest == 0:
	print(l)
else:
	print(l-highest+1)

n = int(input())
s = str(input())
l = len(s)
prev = '';
ss = ''
max_len=0
for i in s:
    ss+=i
    print(ss+"  "+s[len(ss):len(ss)+len(ss)])
    if ss == s[len(ss):len(ss)+len(ss)]:
        max_len = len(ss)
if max_len>0:
    print(l-max_len+1)
else:
    print(l)

def iden(s1, s2):
	# print(s1, s2)
	if len(s2) < len(s1):
		return False
	for i in range(len(s1)):
		# print(i, "----")
		if not s1[i] == s2[i]:
			# print("HEEEYY")
			return False
	return True

n = input("")
s = input("")

cur = s[0]
i = 0
res = 0
while cur != s:
	i = len(cur)
	if iden(cur + cur, s):
		# print(cur + cur)
		res = len(cur)-1
		cur = cur + cur
	else:
		cur += s[i]
	# print(cur)

print(len(s)-res)

n = int(input())
s = input()
x = 1
for i in range(n//2, 0, -1):
    if (s[:i] == s[i:i*2]):
        x = i
        break
print(n-(x-1), x)

n=int(input())
a=input()
i=1
j=0
#print(2*i)
while i in range(n):
    if a[0:i]==a[i:2*i]:
        if j<(i):
            j=i
            i+=i
    else:
        i+=1

print([n-j,n-j+1][j>0])

n = int(raw_input())
s = raw_input()

best = n
for l in range(1, (n + 1) / 2):
    if s[:l] == s[l:2*l]:
        best = l + 1 + n - 2 * l

print best