from collections import Counter

N = int(input())
S = input()
min_stone = Counter(S).most_common()[-1][1]
if min_stone == N:
    min_stone = 0

for i in range(1,N):
    A, B = Counter(S[:i])['#'], Counter(S[i:])['.']
    if min_stone > A+B:
        min_stone = A+B
print(min_stone)