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

ans=[]
for i in range(0,n):
    ans.append(-1)
ans[0]=0

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

print ans[n-1]
