from collections import Counter
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def ii(): return int(stdin.readline())
def li(): return map(int, stdin.readline().split())
def ns(): return stdin.readline().rstrip()
N = ii()
S = ns()
cnt = Counter(S)
B, W = cnt["#"], cnt["."]
left_b = 0
left_w = 0
total = float("inf")
for s in S:
    if s == "#":
        left_b += 1
    else:
        left_w += 1
    total = min(total, left_b + W - left_w)


print(total)
