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

while len(s) > 0 and s[0] == '.':
    s = s[1:]
while len(s) > 1 and s[-1] == '#':
    s = s[:-1]

b, w = 0, 0
for c in s:
    if c == '.':
        w += 1
    else:
        b += 1
print(min(b, w))