# -*- coding: utf-8 -*-


def main():
    n = int(input())
    s = list(input())

    if len(set(s)) == 1:
        print(0)
    else:
        ans = 0
        i = 0

        while i < n - 1:
            if s[i] == '#' and s[i + 1] == '.':
                ans += 1

                if i + 2 < n:
                    if s[i + 2] == '#':
                        i += 2
                    elif s[i + 2] == '.':
                        i += 3
                else:
                    print(ans)
                    exit()
            else:
                i += 1

    print(ans)


if __name__ == '__main__':
    main()
