TSS '22 CC P1 - Mud Puddles

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 256M

Problem type

You have decided to go hiking on a trail consisting of N characters.

Each character will be one of the following:

  • - representing dry ground
  • * representing wet mud

Before your trip, you decide to count the number of mud puddles to make sure you're not getting too dirty. Any contiguous sequence of * is considered one mud puddle.

Given N and a string representing the trail, output the total number of mud puddles.


1 \le N \le 5000

Input Specification

The first line of input contains an integer N.

The second line of input contains N characters (- or *) representing the trail.

Output Specification

Output a single integer, the total number of mud puddles.

Sample Input


Sample Output



There are no comments at the moment.