<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_mongo_config_simple(app, connection_string, collection_name):
 """ Configure the app to use MongoDB. :param app: Flask Application :type app: Flask :param connection_string: in format host:port:database or database (default: sacred) :type connection_string: str :param collection_name: Name of the collection :type collection_name: str """

    split_string = connection_string.split(":")
    config = {"host": "localhost", "port": 27017, "db": "sacred"}
    if len(split_string) > 0 and len(split_string[-1]) > 0:
        config["db"] = split_string[-1]
    if len(split_string) > 1:
        config["port"] = int(split_string[-2])
    if len(split_string) > 2:
        config["host"] = split_string[-3]
    app.config["data"] = PyMongoDataAccess.build_data_access(
        config["host"], config["port"], config["db"], collection_name)