#include using namespace std; #define dump(...) do{print_vars(cout<<"# "<<#__VA_ARGS__<<'=',__VA_ARGS__);cout<int(a);) #define rep(i,n) repi(i,0,n) #define per(i,n) peri(i,0,n) #define all(c) begin(c),end(c) #define mp make_pair #define mt make_tuple using uint=unsigned; using ll=long long; using ull=unsigned long long; using vi=vector; using vvi=vector; using vl=vector; using vvl=vector; using vd=vector; using vvd=vector; using vs=vector; templatebool chmin(T& a,const U& b){return a>b?(a=b,1):0;} templatebool chmax(T& a,const U& b){return a void print_vars(ostream& os,const Car& car,const Cdr&... cdr){ print_vars(os< ostream& operator<<(ostream& os,const pair& p){ return os<<'('< void print_tuple(ostream&,const Tuple&){} template void print_tuple(ostream& os,const Tuple& t){ os<(t)<<(sizeof...(Cdr)?",":""); print_tuple(os,t); } template ostream& operator<<(ostream& os,const tuple& t){ print_tuple<0,Args...>(os<<'(',t); return os<<')'; } template basic_ostream& operator<<(basic_ostream& os,const C& c){ os<<'['; for(auto i=begin(c);i!=end(c);++i) os<<(i==begin(c)?"":" ")<<*i; return os<<']'; } constexpr int INF=1e9; constexpr int MOD=1e9+7; constexpr double EPS=1e-9; int main() { #ifndef _GLIBCXX_DEBUG ios_base::sync_with_stdio(false); cin.tie(nullptr); constexpr char endl='\n'; #endif for(int n;cin>>n&&n;){ n--; vi a; { string s; cin>>s; for(char c:s) a.push_back(c=='#'); } if(count(all(a),1)==0){ cout<<0<n){ reverse(all(a)); n=a.size()-1-n; } int l=a.size(); rep(i,a.size()) if(a[i]){ l=i; break; } int res=0; int i=n; for(;l