#include <bits/stdc++.h>
using namespace std;
using S = set<long long>;
using D = deque<long long>;
using L = vector<long long>;
using M = map<int, long long>;
using A = vector<vector<long long>>;
using Q = priority_queue<long long>;
using U = unordered_map<int, long long>;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  string s;
  cin >> n >> s;
  long long l = 0;
  long long r = count(s.begin(), s.end(), '.');
  L ans;
  ans.push_back(r);
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      l++;
      r--;
      ans.push_back(l + r);
    }
  }
  cout << *min_element(ans.begin(), ans.end()) << endl;
}
