import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
s = '.' + read().rstrip().decode() + '#'
index1 = s.index('#')
index2 = n + 2 - s[::-1].index('.')
print(min(s[index1:index2].count('#'), s[index1:index2].count('.')))
