#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int maxn = 1;
const double EPS = 1e-8;
class CStones {
 public:
  void solve(std::istream& in, std::ostream& out) {
    int n;
    string s;
    in >> n;
    in >> s;
    int r = n - 1, l = n;
    int res = 0;
    for (int i = 0; i < n; ++i) {
      if (s[i] == '#') {
        l = i;
        break;
      }
    }
    bool flag = false;
    for (int i = l; i < n; ++i) {
      if (s[i] == '.') {
        flag = true;
        break;
      }
    }
    if (flag) {
      int s1 = 0, s2 = 0;
      for (int i = l; i < n; ++i) {
        if (s[i] == '#')
          s1++;
        else
          s2++;
      }
      int len = 0;
      if (l != n)
        for (int i = n - 1; i >= 0; --i) {
          if (s[i] == '.') break;
          len++;
        }
      out << min(s1 - len, s2) << '\n';
    } else
      out << 0 << '\n';
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  CStones solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
