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

cnt = 0
for s in S:
    if s == ".":
        cnt += 1
    else:
        break
ws = S[cnt:]
w = S.count(".")
bs = S[::-1]
cnt = 0
for s in bs:
    if s == ".":
        cnt += 1
    else:
        break
bs = bs[cnt:]
b = bs.count("#")
print(min(w, b))
