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

flag = False
count_w = 0
count_b = 0
for i in list(S):
    if(i == '#'):
       count_b += 1
       if(flag != True):
           flag = True
    else:
        if(flag):
            count_w += 1
print(min(count_w, count_b))
