N = int(input())
S = input()
# . = しろ
# # = 黒
# #の横に.がないようにしたい
# #の横に.があったら#を.に変える
# or #の横に.があったら.を#に変える

# when do you replace now char to .
# 

# テストケース
"""
11
#..#.##.##.
.....######
"""
# => .....# = 2

def inorderReplace(S , N): 
    S = list(S)
    cnt = 0
    for i in range(N - 1) : 
        nowChar = S[i]
        nextChar = S[i + 1]
        if nowChar == "#" and nextChar == "." : 
            cnt += 1
            if i + 2 >= N - 1 : 
                S[i + 1] = "#"
            else : 
                nextNextChar = S[i + 2]
                if nextNextChar == "." : 
                    S[i] = "."
                else : 
                    S[i] = "$"
    return cnt

cnt = inorderReplace(S , N)
print(cnt)