Everybody knows that the Berland citizens are keen on health, especially students. Berland students are so tough that all they drink is orange juice!

Yesterday one student, Vasya and his mates made some barbecue and they drank this healthy drink only. After they ran out of the first barrel of juice, they decided to play a simple game. All n people who came to the barbecue sat in a circle (thus each person received a unique index b_{i} from 0 to n - 1). The person number 0 started the game (this time it was Vasya). All turns in the game were numbered by integers starting from 1. If the j-th turn was made by the person with index b_{i}, then this person acted like that:  he pointed at the person with index (b_{i} + 1) mod n either with an elbow or with a nod (x mod y is the remainder after dividing x by y);  if j ≥ 4 and the players who had turns number j - 1, j - 2, j - 3, made during their turns the same moves as player b_{i} on the current turn, then he had drunk a glass of juice;  the turn went to person number (b_{i} + 1) mod n. 

The person who was pointed on the last turn did not make any actions.

The problem was, Vasya's drunk too much juice and can't remember the goal of the game. However, Vasya's got the recorded sequence of all the participants' actions (including himself). Now Vasya wants to find out the maximum amount of juice he could drink if he played optimally well (the other players' actions do not change). Help him.

You can assume that in any scenario, there is enough juice for everybody.


-----Input-----

The first line contains a single integer n (4 ≤ n ≤ 2000) — the number of participants in the game. The second line describes the actual game: the i-th character of this line equals 'a', if the participant who moved i-th pointed at the next person with his elbow, and 'b', if the participant pointed with a nod. The game continued for at least 1 and at most 2000 turns. 


-----Output-----

Print a single integer — the number of glasses of juice Vasya could have drunk if he had played optimally well.


-----Examples-----
Input
4
abbba

Output
1

Input
4
abbab

Output
0



-----Note-----

In both samples Vasya has got two turns — 1 and 5. In the first sample, Vasya could have drunk a glass of juice during the fifth turn if he had pointed at the next person with a nod. In this case, the sequence of moves would look like "abbbb". In the second sample Vasya wouldn't drink a single glass of juice as the moves performed during turns 3 and 4 are different.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
moves = input()

turns_vasnja = int((len(moves)-1) / n)

count = 0
for i in range(1, turns_vasnja+1):
    if moves[n * i - 3] == moves[n * i - 2] == moves[n * i - 1]:
        count += 1

print(count)


n=int(input())

s=input()
nn=len(s)
ans=0
for i in range(n,nn,n):
    if(s[i-1]+s[i-2]+s[i-3]=='aaa' or s[i-1]+s[i-2]+s[i-3]=='bbb'):
        ans+=1
print(ans)


n = int(input())
s = input().strip()
pl = 0
ans = 0
for q in range(len(s)):
    if q>=3 and pl==0:
        if s[q-3]==s[q-2]==s[q-1]:
            ans+=1
    pl = (pl+1) % n 
print(ans)

n = int(input())                
s = input()
ans = 0
for i in range(n, len(s), n):
    if s[i - 3:i] in ('aaa', 'bbb'):
        ans += 1
print(ans) 


n = int(input())
s = input()
ans = 0
for i in range(len(s)):
    if i % n == 0 and i >= 3:
        if s[i-1] == s[i-2] == s[i-3]:
            ans += 1
print(ans)

cnt, n, ans = 1, int(input()), 0
s = input()
for i in range(1, len(s)):
	if cnt == 0 and s[i - 1] == s[i - 2] == s[i - 3]:
		ans += 1
	cnt += 1
	if cnt == n:
		cnt = 0
print(ans)

n = int(input())
string = input()
count = 0
i = n
while i < len(string):
    flag = False
    if string[i - 1] == string[i - 2] and string [i - 2] == string[i - 3] and i >= 3:
        flag = True
    if flag:
        count += 1
    i += n
print(count)

a=int(input())
s=input()
n=0
for i in range(a,len(s),a):
    if s[i-2]==s[i-1] and s[i-1]==s[i-3] :
        n+=1   
print(n)


import sys
fin = sys.stdin

n = int(fin.readline())
b = fin.readline().strip()
m = len(b)

res = 0
for i in range(n, m, n):
  if b[i - 3] == b[i - 2] == b[i - 1]:
    res += 1

print(res)

n = int(input())
s = input()
cnt = 0
for i in range(len(s))[n::n]:
  if s[i-1] == s[i-2] and s[i-1] == s[i-3]:
    cnt += 1
print(cnt)


n = int(input())
s = input().strip()
ans = 0
for i in range(n, len(s), n):
    ans += s[i - 3:i] == "bbb" or s[i - 3:i] == 'aaa'
print(ans)


n=int(input())
s=input()
a,b=n,0
while a<len(s):
	if s[a-3]==s[a-2]==s[a-1]:b+=1
	a+=n
print (b)

n=input('')
n=int(n)
str=input('')
l=len(str)
count=0
if l<=4:
    print(0)
elif l>4:
        c=n
        while c<=(l-1):
          str1=str[c-3:c]
          if str1=='aaa' or str1=='bbb':
            count+=1
          c+=n
        print(count)
    


n = int(input())
s = input()
i = n
ans = 0
while i < len(s):
	if s[i - 1] == s[i - 2] and s[i - 2] == s[i - 3]:
		ans += 1
	i += n
print(ans)


n = int(input())
moves = input()
i = n
count = 0
while(i < len(moves)):
    m = moves[i - 1] 
    if(m == moves[i - 2] and m == moves[i - 3] and m == moves[i - 3]):
        count += 1
    i += n
print(count)

n = int( input() )
s = input()
i=n
l = len(s)
tot = 0
while i<len(s):
	if s[i-1] == s[i-2] == s[i-3]:
	    tot += 1
	i += n
print(tot)


n=int(input())
s=input()
a,b=n,0
while a<len(s):
	if s[a-1]==s[a-2]==s[a-3]:
		b+=1
	a+=n
print(b)


n = int(input());
s = input();
cnt = 0;
for i in range(len(s))[n::n]:
    if s[i - 1] == s[i - 2] and s[i - 2] == s[i - 3]:
        cnt += 1;
print(cnt);


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

while (len(s)-1) % n != 0:
    s = s[:len(s)-1]

sol = 0
for i in range(len(s)-1, 3, -n):
    if s[i-1] == s[i-2] and s[i-2] == s[i-3]: sol += 1

print(sol)


n=int(input())
s=input()
count=0
i=(n)
while i<len(s):
    if s[i-1]==s[i-2]==s[i-3]:
        count+=1
    i+=n
print(count)

n, s, ans = int(input()), input(), 0
for i in range(len(s)):
    if i > 2 and not i % n and s[i - 1] == s[i - 2] == s[i - 3]:
            ans += 1
print(ans)

3

n = int(input())
s = input()
print(len([1 for i in range(n, len(s), n) if len(set(list(s[i - 3:i]))) == 1]))


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

sl = len(s)
d = 0

for i in range(n, sl, n):
    if s[i-1] == s[i-2] and s[i-1] == s[i-3]:
        d += 1

print(d)


#332A Down the Hatch!

n = int(input())
actions = input()
glasses = 0
for i in range(n, len(actions), n):
	if actions[i-1] == actions[i-2] == actions[i-3]:
		glasses += 1
print(glasses)

s, n, t = 0, int(input()), input()
print(sum(t[i - 3: i] in ['aaa', 'bbb'] for i in range((3 // n + 1) * n , len(t), n)))