You are given a string $$$S$$$ of length $$$n$$$.
The string $$$S$$$ consists only of the character 'A'.
Your task is to count how many substrings of $$$S$$$ are equal to "AAA".
A substring is a contiguous part of the string.
The first and only line contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$) — the length of the string $$$S$$$.
It is guaranteed that $$$S$$$ consists of exactly $$$n$$$ characters, and all of them are equal to 'A'.
Print a single integer — the number of substrings of $$$S$$$ that are equal to "AAA".
5
3
1
0
For $$$n = 5$$$, the string is "AAAAA".
The substrings equal to "AAA" start at positions $$$1$$$, $$$2$$$, and $$$3$$$, so the answer is $$$3$$$.
| Contests - ACM Student Chapter - PSUT |
|---|
| Закрытая |
| Зритель |
| Название |
|---|


