#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int N;
    string S;
    cin >> N >> S;
    
    vector<int> white(N + 1, 0);
    for (int i = 1; i <= N; ++i) {
        white[i] = white[i - 1] + (S[i - 1] == '.' ? 1 : 0);
    }
    int ans = N;
    for (int i = 0; i <= N; ++i) {
        ans = min(ans, white[N] + i - 2 * white[i]);
    }

    cout << ans << endl;

    return 0;
}