N = int(eval(input()))

S = eval(input())



import numpy as np



N = np.zeros((len(S),2))

B,W = 0,1

# 左から.W 右へ#B

for idx,s in enumerate(S):

  if s is "#":

    N[idx,B] = N[idx-1,B] + 1

    N[idx,W] = N[idx-1,W]

  else:

    N[idx,B] = N[idx-1,B]

    N[idx,W] = N[idx-1,W] + 1



print((int(min([N[i,B]+N[-1,W]-N[i,W] for i in range(len(S)-1)]+[N[-1,W],N[-1,B]]   ))))
N = int(eval(input()))

S = eval(input())

N = [[0 for _ in range(2)] for _  in  range(len(S))]



B,W = 0,1

# 左から.W 右へ#B

for idx,s in enumerate(S):

  if s is "#":

    N[idx][B] = N[idx-1][B] + 1

    N[idx][W] = N[idx-1][W]

  else:

    N[idx][B] = N[idx-1][B]

    N[idx][W] = N[idx-1][W] + 1



print((int(min([N[i][B]+N[-1][W]-N[i][W] for i in range(len(S)-1)]+[N[-1][W],N[-1][B]]   ))))

N = int(eval(input()))
S = eval(input())
import numpy as np

N = np.zeros((len(S), 2))
B, W = 0, 1
# 左から.W 右へ#B
for idx, s in enumerate(S):
    if s is "#":
        N[idx, B] = N[idx - 1, B] + 1
        N[idx, W] = N[idx - 1, W]
    else:
        N[idx, B] = N[idx - 1, B]
        N[idx, W] = N[idx - 1, W] + 1
print(
    (
        int(
            min(
                [N[i, B] + N[-1, W] - N[i, W] for i in range(len(S) - 1)]
                + [N[-1, W], N[-1, B]]
            )
        )
    )
)

N = int(eval(input()))
S = eval(input())
N = [[0 for _ in range(2)] for _ in range(len(S))]
B, W = 0, 1
# 左から.W 右へ#B
for idx, s in enumerate(S):
    if s is "#":
        N[idx][B] = N[idx - 1][B] + 1
        N[idx][W] = N[idx - 1][W]
    else:
        N[idx][B] = N[idx - 1][B]
        N[idx][W] = N[idx - 1][W] + 1
print(
    (
        int(
            min(
                [N[i][B] + N[-1][W] - N[i][W] for i in range(len(S) - 1)]
                + [N[-1][W], N[-1][B]]
            )
        )
    )
)

-import numpy as np - -N = np.zeros((len(S), 2)) +N = [[0 for _ in range(2)] for _ in range(len(S))] -        N[idx, B] = N[idx - 1, B] + 1 -        N[idx, W] = N[idx - 1, W] +        N[idx][B] = N[idx - 1][B] + 1 +        N[idx][W] = N[idx - 1][W] -        N[idx, B] = N[idx - 1, B] -        N[idx, W] = N[idx - 1, W] + 1 +        N[idx][B] = N[idx - 1][B] +        N[idx][W] = N[idx - 1][W] + 1 -                [N[i, B] + N[-1, W] - N[i, W] for i in range(len(S) - 1)] -                + [N[-1, W], N[-1, B]] +                [N[i][B] + N[-1][W] - N[i][W] for i in range(len(S) - 1)] +                + [N[-1][W], N[-1][B]]