n = int(input())
S = input()
w,b = 0,0
for s in S:
    if s == '.':
        w += 1
    else:
        b += 1

if b > w:
    if S[len(S)-1] == '#':
        print(w-1)
    else:
        print(w)
else:
    if S[len(S)-1] == '#':
        print(b-1)
    else:
        print(b)
