#include <iostream>
#include <string>
using namespace std;
int main(void)
{
int N;
cin >> N;
string arr;
cin >> arr;
int min = N; //거리 최솟값
int first; //왼쪽에 있는 공석 위치
int last; //오른쪽에 있는 공석 위치
for (int i = 0; i < arr.length(); i++) //첫 번째 공석 위치 찾기
{
if (arr[i] == '.') {
first = i;
break;
}
}
for (int i = first + 1; i < arr.length(); i++)
{
if (arr[i] == '.') { //오른쪽에 있는 공석 위치 찾기
last = i;
if (min > last - first - 1) //거리의 차이가 최솟값보다 더 작다면 저장
min = last - first - 1;
first = last; //오른쪽에 있는 공석의 위치를 왼쪽에 있는 공석의 위치로 지정
}
}
cout << min; //최솟값 출력
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKHZvaWQpCnsKCWludCBOOwoJY2luID4+IE47CgoJc3RyaW5nIGFycjsKCWNpbiA+PiBhcnI7CgoJaW50IG1pbiA9IE47CQkvL+qxsOumrCDstZzshp/qsJIKCWludCBmaXJzdDsJCQkvL+yZvOyqveyXkCDsnojripQg6rO17ISdIOychOy5mAoJaW50IGxhc3Q7CQkJLy/smKTrpbjsqr3sl5Ag7J6I64qUIOqzteyEnSDsnITsuZgKCWZvciAoaW50IGkgPSAwOyBpIDwgYXJyLmxlbmd0aCgpOyBpKyspCS8v7LKrIOuyiOynuCDqs7XshJ0g7JyE7LmYIOywvuq4sAoJewoJCWlmIChhcnJbaV0gPT0gJy4nKSB7CgkJCWZpcnN0ID0gaTsKCQkJYnJlYWs7CgkJfQoJfQoKCWZvciAoaW50IGkgPSBmaXJzdCArIDE7IGkgPCBhcnIubGVuZ3RoKCk7IGkrKykKCXsKCQlpZiAoYXJyW2ldID09ICcuJykgewkJCQkvL+yYpOuluOyqveyXkCDsnojripQg6rO17ISdIOychOy5mCDssL7quLAKCQkJbGFzdCA9IGk7CgkJCWlmIChtaW4gPiBsYXN0IC0gZmlyc3QgLSAxKQkJLy/qsbDrpqzsnZgg7LCo7J206rCAIOy1nOyGn+qwkuuztOuLpCDrjZQg7J6R64uk66m0IOyggOyepQoJCQkJbWluID0gbGFzdCAtIGZpcnN0IC0gMTsKCQkJZmlyc3QgPSBsYXN0OwkJCQkJLy/smKTrpbjsqr3sl5Ag7J6I64qUIOqzteyEneydmCDsnITsuZjrpbwg7Jm87Kq97JeQIOyeiOuKlCDqs7XshJ3snZgg7JyE7LmY66GcIOyngOyglQoJCX0KCX0KCWNvdXQgPDwgbWluOwkJCQkJCQkvL+y1nOyGn+qwkiDstpzroKUKfQ==