n = int(input())
s = input()
sr = s[::-1]
left_b = 0
right_w = 0
first_w = n
last_b = n
for i in range(n):
    if s[i] == "#":
        first_w = i
        break
for i in range(n):
    if sr[i] == ".":
        last_b = i
        break
if first_w+last_b == n:
    print(0)
    exit()

loop = n//2
for i in  range(loop):
    if s[i] == "#":
        left_b += 1
    if sr[i] == ".":
        right_w += 1
print(left_b + right_w)