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()
r = N - 1
while S[r] == "#":
    r -= 1
cnt = Counter(S[:r+1])
print(min(cnt["."], cnt["#"]))
