This invention provides thienopyrimidine derivatives of theformula,(see formula I)wherein R1 stands for hydrogen atom, an alkyl group or thelike; R2 stands for a hydrogen atom, an alkyl or amino group orthe like, R3 stands for an alkyl, alkenyl or alkylthio group or thelike or a group Y-X-; or R2 and R3 may together formtetramethylene group; X standing for a direct bond or linkinggroup such as CH2, CH(OH), S, O, NH; Y standing for asubstituted or unsubstituted aromatic carbocycylic, aromaticheterocylic, cycloalkyl or saturated heterocyclic group or thelike; Z stands for S or O, and n is 0 or an integer of 1 to 4,or salts thereof, which exhibit an inhibitory effect on PDE9, and aretherefore useful for prevention or treatment of overactive bladdersyndrome, pollakiuria, urinary incontinence, dysuria associated withprostatic hyperplasia, urolithiasis, Alzheimer's disease, chronicobstructive pulmonary disease, myocardial infarction, thrombosis,diabetes and the like.