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

flag = True
cnt_b = 0
cnt_w = 0

for i in S:
    if flag and i == ".":
        #print("debag flag")
        continue
    if i == "#":
        #print("debag b")
        flag = False
        cnt_b += 1
    else:
        #print("debag w")
        cnt_w += 1

if cnt_b < cnt_w:
    print(cnt_b)
else:
    print(cnt_w)