# coding: utf-8
# Your code here!
N = int(input())
S = input()
black = 0
white = 0
l = [] # 

for s in S:
    if s == "#":
        black += 1
    else:
        white += 1

leftBlack = 0
rightWhite = white
for s in S:
    if s == "#":
        leftBlack += 1
    else:
        rightWhite -= 1
        
    l.append(leftBlack + rightWhite)
    
print(min(l))