N=int(input())
S=list(input())
counterB=0
counterW=0
for i in range(1, N):
    if S[i] == '#':
        counterB += 1
    if S[i] == '.':
        counterW += 1
if counterB == N - 1 or counterW == N - 1:
    print(0)
elif counterB < counterW:
    print(counterB)
else:
    print(counterW)