Study of direct CP in charmed B decays and measurement of the CKM angle gamma at Belle