N = int(input())
S = input()
c = 0
A = int(S.count("."))
B = N - A
if len(S) == N:
    if 1 <= N <= 2 * 10 ** 5:
        if "." in S:
            if "#" in S:
                S.replace("#.","ee")
                D = S.find("e") + 1
                C = N - D + 1                
                print(N - C + B)
            else:
                print(0)
        else:
            print(0)