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()
index = n - 1
for i, ss in enumerate(s):
    if ss == '#':
        index = i
        break
print(min(s[index:].count('#'), s[index:].count('.')))
