
# -*- coding: utf-8 -*-
n = int(input())
s = list(input())

sum_w = [0]*(n+1)
sum_b = [0]*(n+1)

for i in range(n):
    if s[i] == '#':
        sum_b[i+1] = sum_b[i] + 1
    else:
        sum_b[i+1] = sum_b[i]

    if s[i] == '.':
        sum_w[i+1] = sum_w[i] + 1
    else:
        sum_w[i+1] = sum_w[i]

# 0番目からi番目までの黒の数
black = sum_b[i]
#  i+1番目からn番目(最後)までの白の数
white = sum_w[n]-sum_w[i]

ans = n
for i in range(n+1):
    ans = min(ans, black + white)
print(ans)