# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

n = int(input())
s = input()
a = list(s)

shiro = 0
kuro = 0
flg = False
start = 0
end = 0
for i in range(n):
    if s[i] == '#':
        start = i
        break
for i in reversed(range(n)):
    if s[i] == '.':
        end = i
        break
for i in range(start, end + 1):
    if s[i] == '#':
        kuro += 1
    else:
        shiro += 1
mx = min(kuro, shiro)
print(mx)
