# -*- coding: utf-8 -*-
"""
@author: H_Hoshigi
"""

def main():
    N = int(input())
    S = input()

    hash_r = 0
    while S[hash_r] != "#" and hash_r <= N-2:
        hash_r += 1

    dot_l = len(S)-1
    while S[dot_l] != "." and dot_l >= 1:
        dot_l -= 1

    print(
        min(
            S[hash_r+1:].count("."),
            S[:dot_l].count("#")
        )
    )

if __name__ == "__main__":
    main()

