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

cnt = 0
stones = list(S)

# print(stones)
flg = False
cntKuro = 0
cntShiro = 0
for i in range(0, N):
    if flg:
        if stones[i] == ".":
            cntKuro += 1
        else:
            cntShiro +=1
    elif stones[i] == "#":
        flg = True

if cntKuro > cntShiro :
    print(cntShiro)
else:
    print(cntKuro)