Trick or Treat!


Submit solution

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

You are going trick-or-treating along a row of \(N\) houses.
Each house will either say "Trick" or "Treat".

You start with \(0\) candies.
Each "Treat" gives you \(1\) candy, and each "Trick" makes you lose \(1\) candy.
After visiting all the houses, determine how many candies you have (it's possible to have negative candy!).

Input Specification

The first line will contain an integer \(N\) \((1 ≤ N ≤ 1000)\), the number of houses.
The second line contains \(N\) space-separated strings, each either "Trick" or "Treat".

Output Specification

Print one integer — the final number of candies after visiting all the houses.

Sample Input

5
Treat Trick Treat Treat Trick

Sample Output

1

Comments

There are no comments at the moment.