n = int(input())
s = input()
i = 0
b = 0
w = 0

while i < n:
    if s[i:i+1] == '#':
        b += 0
        i += 1
        while i < n:
            if s[i:i+1] == '#':
                b += 1
            else:
                w += 1
            i += 1
    else:
        i += 1

print(min([b, w]))