# -*- coding: utf-8 -*-

def readInts():
  return [int(s) for s in input().split(" ")]

def main():
  N = readInts()[0]
  S = input()

  st = 0
  for i in range(N):
    if S[i] != '.':
      st = i
      break
  ed = N
  for i in range(N):
    if S[N - 1 - i] != '#':
      ed = N - i
      break
  counts = {"#": 0, ".": 0}
  for i in range(st, ed):
    counts[S[i]] += 1

  print(min(counts["#"], counts["."]))

if __name__ == "__main__":
  main()
