N = int(input())
S = list(input())

zeros = ["." for i in range(N)]
ones = ["#" for i in range(N)]
lastone = ["." for i in range(N - 1)]
lastone.append("#")
firstzero = ["#" for i in range(N - 1)]
firstzero.insert(0, ".")
z = 0
o = 0
l = 0
f = 0

for i in range(N):
    if S[i] != zeros[i]:
        z += 1

for i in range(N):
    if S[i] != ones[i]:
        o += 1

for i in range(N):
    if S[i] != lastone[i]:
        l += 1

for i in range(N):
    if S[i] != firstzero[i]:
        f += 1

print(min([z, o, l, f]))
