N = int(input())
S = input()

S = list(S)
white_count = S.count(".")
black_count = S.count("#")
count = 0

if white_count < black_count:

    for i in range(len(S)-1):
        print(S[i],S[i+1])
        if (S[i]=="#")and(S[i+1]=="."):
            count += 1
            S[i+1] = "#"
else :
    S = reversed(S)
    for i in reversed(range(1,len(S))):
        if (S[i]==".")and(S[i-1]=="#"):
            count += 1
            S[i] =  "."

print(count)