# -*- coding: utf-8 -*-
"""
AtCoder C
"""

def main():
    N=input()
    S=list(map(str,input().split()))[0]
    tmp=False
    num=0
    for s in S:
        # print(s,tmp)
        if s=="#":
            tmp=True
        elif s=="." and tmp:
            num+=1
    print(num)

if __name__ == "__main__":
    main()