Like China, Japan has amalgamated three distinct yet interrelated religious traditions. Confucianism entered the country from the mainland in 405 C.E. through the Korean scholar Wani, and served mainly as a guide to ethics and filial relationships. Buddhism came from China by way of Korea during the 6th century. And Shinto, the native folk religion of the islands which dates from before the Christian Era, still survives in a variety of formats.