class Solution: def countAsterisks(self, s: str) -> int: start = False res = 0 for char in s: if char == "|": start = not start elif char == "*" and not start: res += 1 return res