N = int(input())
S = input()
S_list = list(S)
count = 0

w_num = S.count('.')
b_num = S.count('#')

if '#.' in S:
    if w_num > b_num:
        count = S.count('#.')
    elif w_num <= b_num:
        for i in range(N):
            if S_list[i] == '#' and S_list[i+1] == '.':
                count += 1
                S_list[i+1] = '#'
                S = ''.join(S_list)
            if  '#.' in S:
                pass;
            else:
                break;
print(count)