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

flag = True
cnt_b = 0
cnt_w = 0

while True:
    if len(S) == 1:
        print(0)
        exit()
    elif S[0] == ".":
        S = S[1:]
        #print(S)
    else:
        break

while True:
    if len(S) == 1:
        print(0)
        exit()
    elif S[len(S)-1] == "#":
        S = S[:len(S)-1]
        #print(S)
    else:
        break

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

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