n = int(input())
 
lines = list(input())
 
count_stone = list()
stone = lines[0]
count=0
for i in range(len(lines)):
    if lines[i] == stone:
        count += 1
    else:
        count_stone.append([stone,count])
        stone = lines[i]
        count = 1
    if i == len(lines)-1:
        count_stone.append([stone,count])
    
# print(count_stone)
ans = list()
for i in range(len(count_stone)):
    total = 0
    for j in range(len(count_stone)):
        if j <= i:
            if count_stone[j][0] == '#':
                total += count_stone[j][1]
        else:
            if count_stone[j][0] == '.':
                total += count_stone[j][1]
    ans.append(total)
# print(ans)
print(min(ans))
                