John bought shares of stock in two compaines: S. Inc. and Q. Corp. He purchase a total of 560 shares of stock. S. Inc. pays a dividend of $1.40 per share and Q. Corp. pays a dividend of $1.75 per share. Both dividends are paid annually. After one year John received dividend checks totaling $868. Hoe many shares of each stock doe he owe?