# -*- 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

def dfs(i):
    global memo
    if memo[i] != -1:
        return memo[i]
    if s[i] == ".":
        memo[i] = min(s[:i].count("#"), dfs(i-1)+1)
    else:
        memo[i] = min(dfs(i-1), s[:i].count(".")+1)
    return memo[i]

print dfs(n-1)