[python] How many times a substring occurs