#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = int(input())
S = input()

S2 = map(lambda x: x == '#', S)
c1 = 0
c2 = 0
for i in reversed(list(S2)):
    if i:
        if c2 > 0:
            c1 += 1
    else:
        c2 += 1

print(min(c1, c2))
