from sys import stdin
import sys
N = int(stdin.readline().rstrip())
S = list(stdin.readline().rstrip())
if set(S) == {'#'} or set(S) == {'.'}:
    print(0)
    sys.exit()
first_b = S.index('#')
b_count = S.count('#')
w_count = S[first_b:].count('.')
if b_count < w_count:
    if S[-1] == '#':
        print(b_count-1)
    else:
        print(b_count)
else:
    print(w_count)