#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int> >;
const int INF = 2000000000;
const long long INF64 = 9223372036854775806ll;
const int mod = 1000000007ll;
const long long MOD = 1000000007LL;
int main() {
  int n;
  std::cin >> n;
  string s;
  std::cin >> s;
  std::vector<int> c(n), cc(n);
  if (s[0] == '#') c[0] = 1;
  if (s[n - 1] == '.') cc[n - 1] = 1;
  for (int i = 0; i < (int)(n - 1); i++) {
    c[i + 1] = c[i];
    if (s[i + 1] == '#') c[i + 1]++;
  }
  for (int i = n - 1 - 1; i >= (int)0; i--) {
    cc[i] = cc[i + 1];
    if (s[i] == '.') cc[i]++;
  }
  int ma = c[n - 1];
  for (int i = 0; i < (int)(n - 1); i++) {
    ma = min(ma, cc[i] + c[i + 1]);
  }
  ma = min(ma, cc[0]);
  std::cout << ma << std::endl;
}
