n = int(input())
s = input()

two_pre = ''
one_pre = ''
res = 0
for i in s:
    if two_pre == '.' and one_pre == '#' and i == '.':
        res += 1
        one_pre = i
        two_pre = '.'

    elif one_pre == '#' and i == '.':
        res += 1
        one_pre = '#'
        two_pre = one_pre
        
    else:
        two_pre = one_pre
        one_pre = i
        
print(res)