B. Couple Seats

50 cases Time limit 1000 ms total Memory 256 MB

A row of seats is written as a string: . is a free seat and X is a taken one. A couple wants to sit in two free seats right next to each other.

Return the number of different pairs of seats they could choose.

Constraints:

  • 0 ≤ len(s) ≤ 40
  • s contains only . and X

Examples:

f("..X...") returns 3 (one pair on the left, two on the right)

f("....") returns 3

f(".X.X.") returns 0

f("") returns 0

0 bytes Contest has ended