n = int(input())
s = input()
s1 = '.' + (n - 1) * '#'
s2 = (n - 1) * '.' + '"'
s3 = n * '.'
s4 = n * '#'
p = [0, 0, 0, 0]
for i in range(n):
    if s[i] != s1[i]:
        p[0] += 1
    if s[i] != s2[i]:
        p[1] += 1
    if s[i] != s3[i]:
        p[2] += 1
    if s[i] != s4[i]:
        p[3] += 1
print(min(p))
