n = int(input())
s = list(input())

# 白にする
# res1 = 0
# index1 = 0

res1 = 0
res2 = 0
index1 = 0
index2 = len(s) - 1
if s[0] == ".":
    for i in range(1, len(s)):
        if s[i] != s[i - 1]:
            index1 = i
            break
        index1 = len(s)
if s[-1] == "#":
    for i in range(len(s) - 1, 0, -1):
         if s[i] != s[i - 1]:
             index2 = i - 1
             break


for i in range(index1, index2 + 1):
    if s[i] == ".":
        res1 += 1
for i in range(index1, index2 + 1):
    if s[i] == "#":
        res2 += 1

print(min(res1, res2))
