# -*- coding: utf-8 -*-
"""
AtCoder C
"""
import numpy as np
def encode(S):
    code=[]
    code.append([S[0],1])
    for s in S[1:]:
        if s==code[-1][0]:
            code[-1][1]+=1
        else:
            code.append([s,1])
    return code


def main():
    N=input()
    S=list(map(str,input().split()))[0]
    enS=encode(S)
    print(enS)
    if enS[0]=="." and len(enS)!=1:
        enS=enS[1:]
    out=np.zeros([len(enS)+1])
    for j,e in enumerate(enS):
        if e[0]==".":
            out[:j]+=e[1]
        else:
            out[j:]+=e[1]
    print(int(out.min()))
            






    # tmp=False
    # num=0
    # for s in S:
    #     # print(s,tmp)
    #     if s=="#":
    #         tmp=True
    #     elif s=="." and tmp:
    #         num+=1

    # num2=0
    # bl=0
    # for s in S:
    #     # print(s,tmp)
    #     if s=="#":
    #         num2+=1
    #         bl+=1
    #     else:
    #         bl=0

    # print(min(num,num2-bl))
 
if __name__ == "__main__":
    main()