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

k = 0
flag = s.count("#") > s.count(".")

if flag:
    for i, c in enumerate(s):
        if c == "#":
            if i != len(s) - 1 and s[i + 1] == ".":
                k += 1
else:
    for i, c in enumerate(s):
        if c == ".":
            if i != len(s) - 1 and s[i + 1] == "#":
                k += 1

print(k)
