N = int(input())
S = input()
w = 0
 
for i in range(N):
    if S[i] == '#':
        break

if i == N-1:
    pass
else:
    for j in range(i,N):
        if S[j] == '.':
            w += 1
b = N-i-w
print(min(w,b))