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

S_1 = S.copy()

cnt_n = 0
cnt_r = 0
prev_n = S[0]
prev_r = S_1[0]
suc = 1

for i in range(1, len(S)):
    if prev_n == '#' and S[i] == '.':
        S[i] = '#'
        cnt_n += 1
    if prev_r == '#' and S_1[i] == '.':
        cnt_r += suc
        suc = 0
    else:
        suc += 1
    prev_n = S[i]
    prev_r = S_1[i]
    
print(min([cnt_n, cnt_r]))