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

black = 0
black_counts = []
white = 0
white_counts = []
for i in range(N):
    if S[i] == '#':
        black += 1
    black_counts.append(black)

    if S[-1-i] == '.':
        white += 1
    white_counts.insert(0, white)

min_count = min(black_counts[N-1], white_counts[0])
for i in range(N-1):
    min_count = min(min_count, black_counts[i] + white_counts[i+1])
print(min_count)