def get_format(s):
    """
    Returns the Open Babel format of the given string.
    Note: It is primitive, distinguishes only xyz, smiles, inchi formats.
    >>> print(get_format('C'))
    smi
    >>> print(get_format('InChI=1S/H2O/h1H2'))
    inchi
    >>> print(get_format(get_xyz('C')))
    xyz
    """
    frm = 'unknown'
    lines = s.splitlines()
    n = len(lines)  # number of lines
    if n == 1:
        if s.startswith('InChI'):
            frm = 'inchi'
        else:
            frm = 'smi'
    else:
        try:
            natom = int(lines[0].strip())
            if n >= natom + 2:
                frm = 'xyz'
        except:
            pass

    return frm