import sys
N = int(sys.stdin.readline().rstrip())
S = list(sys.stdin.readline().rstrip())

if len(S) == 1:
    print(0)
    exit()

cnt_b = S.count("#")
cnt_w = N - cnt_b

ans_1 = cnt_b
ans_2 = 0
flag = False
for s in S:
    if s == ".":
        if flag:
            ans_2 += 1
    else:
        if not flag:
            flag = True
            
print(min(ans_1, ans_2))