#!/usr/bin/env python
N = int(input())
S = input()

min = N
tmp = 0
if S.count('#') == N or S.count('.') == N:
    print(0)
else:
    for n in range(N):
        tmp = S[:n].count('#') + S[n:].count('.')
        if tmp < min:
            min = tmp
    print(min)