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

dp = [[2*10**5, 2*10**5] for i in range(N)] # n, 0 -> dont replace min, n.1 -> replaced min
dp[N-1] = [0, 1]

def solve():
  for i in range(N-2, 0, -1):
    if(S[i]=="." and S[i-1]=="#"):
      if S[i+1]=="#":
        dp[i][0] = min(dp[i+1])
        dp[i][1] = 1+dp[i+1][1]
      else:
        dp[i][0] = min(dp[i+1])
        dp[i][1] = 1+min(dp[i+1])
    elif(S[i]=="#" and S[i+1]=="."):
      dp[i][0] = dp[i+1][1]
      dp[i][1] = 1+dp[i+1][0]
    else:
      if(S[i]=="." and S[i+1]=="."):
          dp[i][0] = min(dp[i+1])
          dp[i][1] = 1+dp[i+1][1]
      else:
        dp[i][0] = min(dp[i+1])
        dp[i][1] = 1+min(dp[i+1])
  if(S[0]=="#" and S[1]=="."): return min(1+dp[i+1][0], dp[i+1][1])
  elif(S[0]=="." and S[1]=="."): return min(dp[i+1][0], 1+dp[i+1][1])
  else: return min(dp[i+1])

print(solve())