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

# the number of '#'
p0 = s.count('#')

# the number of '.'
p1 = n - p0

# check if '......#'
if s[-1] == '#':
    p2 = p0 - 1
else:
    p2 = p0

# check if '.#######'
if s[0] == '.':
    p3 = p1
else:
    p3 = p1 + 1

print(min([p0, p1, p2, p3]))