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

num_black = S.count('#')
num_white = S.count('.')


if num_black > num_white:
    cnt = 0
    prev = S[0]
    for i in range(1, len(S)):
        if prev == '#' and S[i] == '.':
            S[i] = '#'
            cnt += 1
        prev = S[i]
else:
    cnt = num_black
    
print(cnt)