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

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

if w_num > b_num and '#.' in S:
    count = S.count('#.')
elif w_num <= b_num and '#.' in S:
    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:
            dammy = 1
        else:
            break;
print(count)