Fannie Mae earns $1.8 billion in third quarter