N = int(input())
S = input()
cnt = 0
str_list = list(S)

while (S.find('#.') != -1):
    index = S.find('#.')

    if index == 0:
        str_list[0] = '.'
    elif index == N - 1:
        str_list[N - 1] = '#'
    elif str_list[index - 1] == '.':
        str_list[index] = '.'
    elif str_list[index - 1] == '#':
        str_list[index + 1] = '#'
    cnt += 1
    S = "".join(str_list)

print(cnt)
