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

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