import copy
N = int(input())
S = list(input())
S2 = copy.copy(S)

w = S.count(".")
b = S.count("#")
r_ans = 0
for i in range(N-1,0,-1):
    if S[i] == "." and S[i-1] == "#":
        S[i-1] = "."
        r_ans += 1
    #print(S)

l_ans = 0

for i in range(N-1):
    if S2[i] == "#" and S2[i+1] == ".":
        S2[i+1] = "#"
        l_ans += 1
    #print(S2)
#print(r_ans,l_ans)

print(min(r_ans,l_ans))