n = int(input())
S = input()
c = S[::-1]
w,b = 0,0

for i in range(len(S)):
    if S[i] != '.':
        break

for e in range(len(c)):
    if c[e] != '#':
        break

for s in range(i,len(S)-e+1):
    if S[s] == '.':
        w += 1
    else:
        b += 1

if b > w:
    print(w)
else:
    print(b)
