Interaction of scandium and titanium atoms with a carbon surface containing five- and seven-membered rings