# -*- coding: utf-8 -*-
n = int(raw_input())
s = str(raw_input())

l = s.strip()
memo=[]
for i in range(0,n):
    memo.append(-1)
memo[0]=0

for i in range(1,n):
    if s[i] == ".":
        memo[i] = min(s[:i].count("#"), memo[i-1]+1)
    else:
        memo[i] = min(memo[i-1], s[:i].count(".")+1)

print memo[n-1]
