n, a, b = map(int, input().split()) s = input().strip() runs = [] i = 0 while i <= len(s) - 3: if s[i:i+3] == 'con': count = 1 i += 3 while i <= len(s) - 3 and s[i:i+3] == 'con': count += 1 i += 3 runs.append(count) else: i += 1 total = 0 for x in runs: pair = a + b if pair == 0: continue # but a and b are >=1, so this is impossible full_pairs = x // pair total += full_pairs * 2 rem = x % pair if rem >= a: total += 1 print(total)