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