Under construction

Still being built. Things may change

Just Laughter

Interview

Time limit2sMemory limit1024 MB

Summary
Find the length of the longest substring made of alternating letters a and h in a string of up to 100,000 lowercase letters.
Level

Easy2 of 10

Topics
String, Implementation
Solved
No attempts yet

Statement

Kolobok likes to laugh a lot. Before meeting a potential opponent, Lisa decides to study his laughter.

Lisa considers laughter to be a sequence of alternating letters a and h. For example, ahahaha, hah, and a are laughter, while abacaba and hh are not.

Kolobok talks very fast, so all of his words run together into one long string. Lisa has a transcript of Kolobok's conversation and wants to know how long he can laugh without stopping. She asks you to find the length of the longest laughter in the conversation.

Input

The first line contains one natural number nn (1≤n≤1051 \le n \le 10^5), the length of the transcript. The second line contains a string of nn lowercase Latin letters, the transcript of Kolobok's conversation.

Output

Print one number, the length of the longest laughter in the conversation.

Examples3

  1. Example 1

    Input
    5
    ahaha
    
    Expected output
    5
    
  2. Example 2

    Input
    24
    ahahrunawayahahsofasthah
    
    Expected output
    4
    
  3. Example 3

    Input
    10
    ahahaahaha
    
    Expected output
    5