import sys

input = sys.stdin.readline
n = int(input())
s = input()[:-1]
flag_w = 0
flag_b = 0
w = 0
b = 0
for i in range(n):
    if s[i] == '#':
        flag_b = 1
    else:
        if flag_b > 0:
            b += 1
    if s[-i-1] == '.':
        flag_w = 1
    else:
        if flag_w > 0:
            w += 1
if flag_w > 0 and flag_b > 0:
    print(min(w, b))
else:
    if flag_b == 0:
        print(w)
    else:
        print(b)
