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

S_list = [S[i] for i in range(len(S))]

t = 0
kekka = 0
count_sharp = 0
count_dot = 0

for x in S_list:
    if x == "#":
        count_sharp += 1
    else:
        count_dot += 1


if S_list[-1] == "#":
    if count_sharp > count_dot:
        for x in S_list:
            if x == ".":
                kekka += 1

    else :
        for x in S_list:
            if x == "#":
                kekka += 1
        
        kekka -= 1

else :
    if count_sharp >= count_dot:
        for x in S_list:
            if x == ".":
                kekka += 1
        kekka -= 1
    else :
        for x in S_list:
            if x == "#":
                kekka += 1

print(kekka)