import sys
import collections


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    s = list(str(readline().rstrip().decode('utf-8')))
    if len(collections.Counter(s)) == 1:
        print(0)
    else:
        sc1 = s.count(".")
        sc2 = s.count("#")
        cnt = 0
        for i in range(1, n):
            if s[-i-1] == "#" and s[-i] == ".":
                cnt += 1
                s[-i-1] = "."
        print(min(cnt, sc1, sc2))


if __name__ == '__main__':
    solve()
