#!/usr/bin/env python3


def count_substrings(haystack, needle):
    return haystack.count(needle)


if __name__ == "__main__":
    print (count_substrings("Python is an language to program in!", "o"))
