import json


def read_profile_emails(number_profiles):
    """Reads the profiles file to get just the emails of the profiles"""
    profile_emails = []
    with open("profiles.JSON") as json_file:
        data = json.load(json_file)
        if number_profiles is True:
            number_profiles = len(data)
        elif number_profiles > len(data):
            number_profiles = len(data)
        for i in range(number_profiles):
            profile_emails.append(data[i]['first_name'] + "." + data[i]['last_name'] + "@gmail.com")
    return profile_emails