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

num_sharp = 0
tmp_sharp = 0
for s in S:
    if s == ".":
        num_sharp += tmp_sharp
        tmp_sharp = 0
    else:
        tmp_sharp += 1

num_sharp2 = 0
tmp_sharp = 0
for s in reversed(S):
    if s == "#": # #-> .
        num_sharp2 += tmp_sharp
        tmp_sharp = 0
    else:
        tmp_sharp += 1

out = min(num_sharp, num_sharp2)
print(out)