# 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
for i in range(n):
    if s[i] == '#':
        if i != n - 1:
            kuro += 1
        flg = True
    else:
        if flg:
            shiro += 1
mx = min(kuro, shiro)
print(mx)
