# coding: utf-8
import re
import bisect
from datetime import datetime as dt


n = input()
s = raw_input()

c = 0
a = 0
for i in range(len(s)):
    if s[i] == '#':
        s = s[i:]
        break
for i in range(len(s), 0, -1):
    if s[i - 1] == '.':
        s = s[:i]
        break
print min(s.count('#'), s.count('.'))
