n = int(input())
s = list(input())
"""
count_1 = 0
for i in range(n-1):
    if s[i] == "#" and s[i+1] == ".":
        count_1 += 1
count_2 = 0
for i in reversed(range(n-1)):
    if s[i] == "#" and s[i+1] == ".":
        count_2 += 1
print(min(count_1,count_2))
"""
print(min(s.count("#"),s.count(".")))