import sys

input = sys.stdin.readline


def main():
    N = int(input())
    S = input().rstrip()

    ans = 0
    i = 0
    while i < N - 1:
        if S[i] == "#" and S[i + 1] == ".":
            ans += 1
            i += 2
        else:
            i += 1

    print(ans)


if __name__ == "__main__":
    main()
