This function will allow you to get all connected posts in a relationship.
Then, you can, for example, use the native PHP Function "count()" to count how many post ID's you received and return that in a ShortCode. hidden link
I think your best option here is to write a PHP function that uses the new relationships API function toolset_get_related_posts to return the number of related posts.
You can then register that function to be used in conditional shortcodes at Toolset > Settings > Front-end Content.
Is this a new M2M relationship rather than a migrated relationship?
The arguments for toolset_get_related_posts are:
[php]
1. post ID or post object from one end of the relationship
2. relationship slug (for new relationships) OR an array of the connected post types for old relationships,
3. role of 1 above in the relationship (e.g. we are starting from the parent)
4. limit
5. offset
6. args array (for meta queries)
7. return post_id's or post_object's
8. role of posts to be returned (e.g. if 3 is parent this would be child)
The remaining arguments are optional, but you need to supply all of the above.
Note that it is possible to return the post count in a variable you specify if you also supply the remaining arguments, so that you wouldn't have to use count().
Together with limit you might say "show me 10 results starting from the 11th result" which would effectively be showing the second page of results where you have 10 results per page.
Regarding your second code sample, the final parameter should be a variable name, which will then contain the number of results.
So if you change the last argument to $found_rows, for example, then you should be able to return $found_rows rather than $autori.
I haven't tested it myself, you are passing the variable by reference, it may be that you have to declare the variable before using it as an argument in toolset_get_related_posts (e.g. set it to zero first).