N = int(input())
S = input()
T = [0 if S[0] == "." else 1]
for s in S[1:]:
    T.append(T[-1] if s == "." else 1+T[-1])
sm = T[-1]
mini = 100000000000000
length = N
for t in T:
    length -= 1
    if mini > t+(length-(sm-t)):
        mini = t+(length-(sm-t))
print(mini)