black = '#'
white = '.'

def main():
    n = int(input())
    s = list(input())

    ans = 0

    for i in range(len(s)):
        if needToChange(s, i):
            s[i] = black
            ans += 1

    print(ans)

def needToChange(s, i):
    if s[i] == white:
        return False
    if i >= len(s) - 1:
        return False
    if s[i + 1] == white:
        return True
    return False

main()
