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

count = 0

while s.count("#.") != 0:
    old_count = s.count("#.")
    s = s.replace("#.", "..")
    new_count = s.count("#.")
    count += old_count - new_count

print(count)