N = int(input())
S = input()
ans = 0
replace_point = -1
while 0 == 0:
    replace_point = S.find("#.")
    right_replace_point = replace_point
    if replace_point == -1:
        break
    left_rep = 1
    right_rep = 1
    if replace_point != 0:
        while 1 == 1:
        # 左を見に行く
            if S[replace_point-1:replace_point] == "#":
                left_rep += 1
                replace_point -= 1
            else:
                break
    if right_replace_point != N:
        while 1 == 1:
        # 右を見に行く
            if S[right_replace_point+2:right_replace_point+3] == ".":
                right_rep += 1
                right_replace_point += 1
            else:
                break
    ans += min(left_rep, right_rep)
    S = S[replace_point+1:]
print(ans)
