#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd
#input=sys.stdin.readline
#import bisect
n=int(input())
s=input()
fw=False
fb=False
b=0
w=0
for i in range(n):
    if fb and s[i]==".":
        w+=1
    if fw and s[n-1-i]=="#":
        b+=1
    if not fb and s[i]=="#":
        fb=True
    if not fw and s[n-1-i]==".":
        fw=True
print(min(b,w))