
        
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
n = int(readline())
s = readline().rstrip().decode('utf-8')
res = 0
ans = 10**9
flag = 0
for i in range(n):
    if flag:
        if s[i] == "#":
            res += 1
    elif i+1 < n and s[i] == "#" and s[i+1] == ".":
        flag = 1
        res += 1

ans = min(ans,res)

res = 0
flag = 0
for i in range(n-1,-1,-1):
    if flag:
        if s[i] == ".":
            res += 1
    elif i-1 >= 0 and s[i] == "." and s[i-1] =="#":
        flag = 1
        res += 1
ans = min(ans,res)
print(ans)
        
