#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
clock_t startTime;
long double getTime() {
  return (long double)(clock() - startTime) / CLOCKS_PER_SEC;
}
int main() {
  startTime = clock();
  int n;
  cin >> n;
  char* c = new char[n];
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  int i = 0, j = n - 1;
  while (c[i] == '.') i++;
  while (c[j] == '#') j--;
  int k = i, count1 = 0, count2 = 0;
  while (k <= j) {
    if (c[k] == '.') count1++;
    if (c[k] == '#') count2++;
    k++;
  }
  cout << min(count2, count1);
  return 0;
}
