n = int(input())
s = input()

flag = False
cnt_w = 0
cnt_b = 0
for i in range(n):
    if s[i] == ".":
        if not flag:
            continue
        else:
            cnt_w += 1
    else:
        flag = True
        cnt_b += 1

print(min(cnt_w, cnt_b))