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

zeros = ["." for i in range(N)]
ones = ["#" for i in range(N)]
two = ['#' for i in range(N - 1)]
two.insert(0, '.')
z = 0
o = 0
f = 0
two_count = 0
two_list = [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] != two:
        f += 1
                
for i in range(1, N - 1):
    two[i] = '.'
    for j in range(N):
        if S[j] != two[j]:
            two_count += 1
    two_list.append(two_count)
    two_count = 0

t = min(two_list)

minval = min([z, o, f, t])
