N = int(input())
S = input()

s = list(S)

change = False
i = 0
count = 0
for c in s:
    if c == '#':
        change = True
    elif change == True:
        count += 1
        change = False
    i += 1

print(count)