# https://atcoder.jp/contests/tenka1-2019-beginner
# -*- coding: utf-8 -*-

n = int(input())
s = input()

flag = 0
counter1 = 0
counter2 = 0
for i in s:
    if i is "." and flag is 0:
        continue

    if i is "#":
        flag = 1
        counter2 += 1

    if i is "." and flag is 1:
        counter1 += 1

print(min(counter1,counter2))