n = int(input())
s = input()
a = []
#  .##..#.##.
w = s.count(".")
b = s.count("#")
m = min(w,b)

bb=0
I = float('inf')
for i in range(n):
    if s[i]=='.':
        w-=1
    if s[i]=='#':
        bb += 1
        a.append(bb+w)
        I = min(a)
print(min(m,n))
