from itertools import accumulate

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

black = [0] * N
white = [0] * N

for i, s in enumerate(S):
    if s == "#":
        black[i] = 1
    else:
        white[i] = 1

black = [0] + black
white = [0] + white

black = list(accumulate(black))
white = list(accumulate(white))[::-1]
#print(black, "境目より左にある黒の数")
#print(white, "境目より右にある白の数")


ans = []
for i in range(N+1):
    ans.append(black[i] + white[i])
        
print(min(ans))
