import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = float("inf")


def main():
    N = int(input())
    S = list(input())
    answer = 0
    for i in range(1, N):
        if S[i - 1] == "#" and S[i] == ".":
            S[i] = "#"
            answer += 1
    print(answer)


if __name__ == "__main__":
    main()
