N = int(input())
S = input()
list = [0]*N

for i in range(N-1):
    list[i+1] = 1 if S[i:i+2] == '#.' else 0

for i in range(N-1):
    if list[i] == 1 and (S[:i-1].count('.') == len(S[:i-1])):
        list[i-1] = 1
        list[i] = 0
    elif list[i] == 1 and S[i+1] == '.':
        list[i+1] = 1

print(sum(list))