#include <bits/stdc++.h>

using namespace std;


int main()
{
    long N, c0 = 0, c1 = 0;
    long count1;
    long sum=0, min = LONG_MAX;
    string str;
 

    cin >> N >> str;

   for (int i = 0; i < N; i++) {
        if (str[i] == '.') {
            count1++;
        }
    }
    sum = count;
    for (int i = 0; i < N; i++) {
        if (str[i] == '#') {
            sum++;
        } else {
            sum--;
        }
        if (sum < min) {
            min = sum;
        }
    }

    cout << min;    
    return 0;   
};


