#include <bits/stdc++.h>
int main() {
  int n;
  std::string s;
  std::cin >> n >> s;
  s.push_back('#');
  int cnt = 0;
  for (int i = 1; i < n;) {
    if (s[i] == '.' && s[i - 1] == '#') {
      while (s[i] == '.') {
        cnt++;
        i++;
      }
    } else
      i++;
  }
  s.pop_back();
  std::reverse(s.begin(), s.end());
  s.push_back('.');
  int cnt_2 = 0;
  for (int i = 0; i < n;) {
    if (s[i - 1] == '.' && s[i] == '#') {
      while (s[i] == '#') {
        cnt_2++;
        i++;
      }
    } else
      i++;
  }
  std::cout << std::min(cnt, cnt_2) << std::endl;
}
