#include <bits/stdc++.h>
int black, white;
int count(int n, char x, std::string s) {
  int idx = 0;
  int ans = (x == '#') ? white : black;
  char opposite = (x == '.') ? '#' : '.';
  if (x == '.') std::reverse(s.begin(), s.end());
  while (idx < n && s[idx] == opposite) {
    ++idx;
    --ans;
  }
  return ans;
}
int main() {
  int n;
  std::string s;
  std::cin >> n >> s;
  for (char c : s) {
    if (c == '#')
      ++black;
    else
      ++white;
  }
  std::cout << std::min(count(n, '#', s), count(n, '.', s)) << std::endl;
  return 0;
}
