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

white = 0
while white<N:
    if S[white]=="#":
        break
    white+=1

black = N-1
while black>0:
    if S[black]==".":
        black+=1
        break
    black-=1

cumulativeSum = []
cs = 0
c = "#"
for i in range(white,black):
    if S[i] != c:
        c = S[i]
        cumulativeSum.append(cs)
        cs = 1
    else:
        cs+=1
cumulativeSum.append(cs)

if sum(cumulativeSum[0::2]) > sum(cumulativeSum[1::2]):
    print(sum(cumulativeSum[1::2]))
else:
    print(sum(cumulativeSum[0::2]))

    
