Under construction

Still being built. Things may change

Beusil's Ttibu-Ttibu Sticker Collection

Interview

Time limit1sMemory limit1024 MB

Summary
Given N uppercase letter stickers, find how many full copies of the word BRONZESILVER can be spelled from them.
Level

Easy2 of 10

Topics
Hash map, String
Solved
No attempts yet

문제

There is a Beusil chip, the second most delicious snack in the world.

Each Beusil chip contains one sticker with a letter from A to Z.

If you collect stickers and mail them to spell BRONZESILVER, they will ship you one bag of Gold Chips, the most delicious snack in the world. Calculate the maximum number of Gold Chip bags you can receive with the stickers you have collected so far.

입력

The first line contains the number of letter stickers you have collected, NN. (1≤N≤1 000)(1 \le N \le 1\,000)

The second line lists NN stickers, each with an uppercase letter.

출력

Print the maximum number of Gold Chip bags you can receive.

Examples2

  1. Example 1

    Input
    12
    BRONZESILVER
    
    Expected output
    1
    
  2. Example 2

    Input
    26
    ABCDEFGHIJKLMNOPQRSTUVWXYZ
    
    Expected output
    0