N = int(input())
S = input()
flag = 0
count1 = 0
count2 = 0
for n in range(N):
    if flag == 0 and S[n] == "#":
        flag = 1
    if flag == 1 and S[n] == ".":
        count1 += 1
    if flag == 1 and S[n] == "#":
        count2 += 1
count=min(count1,count2)
print(count)