n = int(input())
sk = list(input())
target = sk[:]

for i,e in enumerate(sk):
    if e == '.':
        target = target[1:]
    else:
        break

target2 = target[:]

for i,e in enumerate(reversed(target)):
    if e == '#':
       target = target2[:-1]
    else:
        break

#print(n,target2)

result = target2
if len(result) == 0:
    print(0)
    exit(0)

cntA =0
cntB =0
for e in target2:
    if e == '.':
        cntA += 1
    else:
        cntB += 1

print(min(cntA,cntB))

#print(''.join(target))