N = int(input())
S = list(input())
re_S = S[::-1]

x = 0
y = 0
for i in range(N):
    if S[i] == '#':
        x += S[i+1:].count('.')
        break       
    else:
        continue

for i in range(N):
    if re_S[i] == '.':
        y += re_S[i+1:].count('#')
        break       
    else:
        continue
 
print(min(x, y))