n = int(input())
s = list(input())
s2 = list(s)
cnt = 0
cnt2 = 0
for i in range(n):
    if i == 0:
        pass
    else:
        if s[i-1] == "#" and s[i] == ".":
            s[i] = "#"
            cnt += 1
for i in range(n):
    if i == 0:
        pass
    else:
        if s2[i-1] == "#" and s2[i] == ".":
            s2[i-1] = "."
            cnt2 += 1
print(min(cnt, cnt2))
