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

cnt = 0
b_cnt = 0
isBlack = False
for i in range(0,N):
    now = S[i]
    if(now == '#'):
        isBlack = True
        b_cnt += 1
    if(now == '.' and isBlack):
        cnt += 1

print(min(b_cnt,cnt))
