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

counter = 0
for i in range(n-1):
    if s[i] == "#":
        if s[i+1] == ".":
            counter += 1
        else:
            pass
    else:
        pass

print(counter)
