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

ans = 0
while s.find('#.') != -1:
    pos = s.find('#.')
    if s[pos-1] == '#':
        s = s[:pos] + '##' + s[pos+2:]
    elif s[pos+2] == '.':
        s = s[:pos] + '..' + s[pos+2:]
    else:
        s = s[:pos] + '##' + s[pos+2:]
    ans += 1
print(ans)