This page is still under construction.

Parts of this page are still being built. What you see may change.

HI-ARC

Interview

Time limit1sMemory limit1024 MB

Summary
Given a string of uppercase letters, find how many complete sets of H, I, A, R, and C can be taken to make HI-ARC emojis.
Level

Easy2 of 10

Topics
String, Implementation
Solved
No attempts yet

Problem

You are a big fan of π‡πˆ-𝐀𝐑𝐂. So you want to make the emoji above.

You have a string SS of length NN. To make one emoji, you need one each of the characters 𝐇, 𝐈, 𝐀, 𝐑, and 𝐂. Find the maximum number of emojis you can make.

Input

The first line contains the integer NN, the length of string SS. (1≀N≀100 0001 \leq N \leq 100\,000)

The second line contains the string SS. Every character of SS is an uppercase English letter.

Output

Print the maximum number of emojis you can make from the given string SS.

Examples3

  1. Example 1

    Input
    12
    HIARCCRAIHAS
    
    Expected output
    2
    
  2. Example 2

    Input
    4
    HIAR
    
    Expected output
    0
    
  3. Example 3

    Input
    5
    HIARC
    
    Expected output
    1