# coding: utf-8

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

data = []

num_min = N
for i in range(0,N):
    num = S[:i+1].count('#') + S[i+1:].count('.')
    if num < num_min:
        num_min = num

print(num_min)
