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

cnt = 0
cnt_black = 0
should_change = 0
to_fl = 0
for i in range(N):

    if S[i] == '#':
        cnt_black += 1
        to_fl += 1
    else:
        should_change += to_fl
        to_fl = 0


# print(N, cnt_black, N-cnt_black, should_change)

if should_change < N - cnt_black:
    print(should_change)
else:
    print(N-cnt_black)
