N = int(input())
S = input()
S = list(S)
S2 = list(S)
ans = 0
while True:
    cnt = 0
    newS = list(S2)
    i = 0
    while i < (len(S2)-1):
        if S2[i] == '#' and S2[i+1] == '.':
            newS = newS[0:i-cnt*2] + newS[i+2 - cnt*2:]
            ans += 1
            cnt += 1
            i += 1
        i += 1
    S2 = list(newS)
    if cnt == 0:
        break

print(ans)
        
    
    