# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    S = lines.pop(0)
    # reverse
    S = S[::-1]
    try:
        # 白が現れるまで省く
        idx = S.index('.')
        S = S[idx:]
        #あとは少ない方を裏返せば良い
        print(min(S.count('.'), S.count('#')))
    except:
        print(0)

lines = [x.strip() for x in sys.stdin.readlines()]
solve(lines)