# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import math

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

ans = 10**6
blacks = [0 for i in range(N)]
black = 0
white = 0
for i in range(N):
    if S[i] == "#":
        black += 1

    else:
        white += 1
    blacks[i] = black

ans = min(black,white,ans)

# print(blacks)
for i in range(1,N):
    cnt = 0
    cnt += (N-i)-(blacks[N-i]-blacks[i])#black
    cnt += blacks[i-1]#white

    ans = min(ans,cnt)

print(ans)
