def read_natoms(g09_file):
    """
    Opens a g09 log file and returns the number of atoms in the system

    Parameters
    ----------
    g09_file: Path to g09 log file
        File path

    Returns
    -------
    natoms: Integer

    """
    with open(g09_file) as f:
        for line in f:
            if line.strip():
                if line.split()[0] == 'NAtoms=':
                    natoms = int(line.split()[3])
                    break
        return natoms
