# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def PL(L) : print(*L, sep="\n")

N = I()
S = input()

index_s = 0
index_k = N
while index_s < N and S[index_s] == ".":
    index_s += 1
while index_k > 0 and S[index_k-1 : index_k] == "#":
    index_k -= 1

if index_s == N or index_k == 0:
    print(0)
else:
    print(min(S[index_s : index_k].count("#"), S[index_s : index_k].count(".")))
