It’s saved in an option:
$default_posts_per_page = get_option( 'posts_per_page' );
Reference: get_option Parameters
You can see the keys and values of all available options by manually entering the admin url:
/wp-admin/options.php
Edit
Total number of posts:
global $wp_query;
$total_posts = $wp_query->post_count;