def main():
    N = int(input())
    S = input()
    n = 0b0
    ans = 0
    for s in S:
        n<<=1
        if s == "#":
            n += 0b1
        if n & 0b10 == 0b10:
            ans += 1
            n = n>>2+(n&0b1)
    print(ans)


if __name__ == '__main__':
    main()