import sys
from collections import Counter

input = sys.stdin.readline
N = int(input())
S = list(input().strip())
counter = Counter(S)
if len(counter) == 1:
    print(0)
else:
    print(min(counter["."], counter["#"]))