# 2019/04/21
# Tenka1 Programming Contest 2019 - C

n = int(input())
s = input()

bl = [0] * (n+1)
wl = [0] * (n+1)

for i in range(n):
    if s[i] == ".":
        wl[i+1] = wl[i] + 1
        bl[i+1] = bl[i]
    else:
        wl[i+1] = wl[i]
        bl[i+1] = bl[i] + 1

# calc minimum Left black and Right white
mins = 10**6
for i in range(1, n+1):
    wks = bl[i] + (wl[n] - wl[i])
    if mins > wks:
        mins = wks

print(mins)
