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

flag = 0
count = 0
for i in range(N):
    if S[i] == '#':
        flag = 1
    else:
        if flag == 1:
            S[i] = '#'
            count = count + 1

print(count)