Application counting recursively with inout objects