N = int(input())
S = list(input())
pass_flag = False
count = 0
for i in range(N-1):
    if pass_flag:
        pass_flag = False
        continue

    if S[i] == '#' and S[i+1] == '.':
        count += 1
        pass_flag = True
print(count)

