#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int INF = 1e9;
const int di[] = {0, 1, 0, -1};
const int dj[] = {1, 0, -1, 0};
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
int finder(vector<T> vec, T number) {
  auto itr = find(vec.begin(), vec.end(), number);
  size_t index = distance(vec.begin(), itr);
  if (index != vec.size())
    return 1;
  else
    return 0;
}
long long frac(long long n) {
  if (n == 0) return 1;
  return (n * frac(n - 1)) % MOD;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main(int argc, char** argv) {
  long long ans = INF;
  long long n;
  cin >> n;
  char arr[n];
  long long black = 0, white = 0;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    if (arr[i] == '.') black++;
  }
  for (int i = 0; i < n; ++i) {
    if (arr[i] == '#') {
      white++;
    } else {
      black--;
    }
    chmin(ans, white + black);
  }
  cout << ans << endl;
  return 0;
}
