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

# 白にする
res1 = 0
for i in range(len(s) - 1):
    if s[i] == "#":
        res1 += 1

# 黒にする
res2 = 0
for i in range(1, len(s)):
    if s[i] == ".":
        res2 += 1

print(min(res1, res2))