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

left = 0 
right = N
while left < N and S[left] == '.':
    left += 1
while right > 0 and S[right - 1] == '#':
    right -= 1

cb = 0
cw = 0
for c in S[left:right]:
    if c == '#':
        cb += 1
    else:
        cw += 1
print(min(cb, cw))
