#include <bits/stdc++.h>
int N;
std::vector<int> a;
std::string s;
int dfs(int i, int k) {
  if (i == N - 1) {
    a.push_back(k + (s[i] == '.'));
    if (s[i] == '.')
      return 1;
    else
      return 0;
  } else {
    int l = dfs(i + 1, k + (s[i] == '#'));
    a.push_back(k + (s[i] == '.') + l);
    return l + (s[i] == '.');
  }
}
int main() {
  std::cin >> N;
  std::cin >> s;
  dfs(0, 0);
  std::sort(a.begin(), a.end());
  bool f = true;
  for (auto it : a) {
    if (it == '#') {
      f = false;
      break;
    }
  }
  if (f) a[0] = 0;
  std::cout << a[0];
  return 0;
}
