The invention provides a pyrazolopyrimidine derivative of formula (I), wherein, for example, R1 represents —NR1aR1b (wherein R1a and R1b are the same or different and each is a hydrogen atom or aralkyl), R2 represents formula (Ya) [wherein k and m each represents an integer of 0-2, n represents an integer of 0-4, L represents a single bond, R5 represents halogen, R6 represents aryl, X represents —CR8 (wherein R8 represents a hydrogen atom), and R7 represents a hydrogen], R3 represents —SO2R13a [wherein R13a represents lower alkoxy, —NR13dC(═O)R13e (wherein R13d represents a hydrogen atom, and R13e represents lower alkyl)], and R4 represents a hydrogen atom, or a pharmaceutically acceptable salt thereof. The invention also provides a medicament containing the pyrazolopyrimidine derivative, as well as a method of using the pyrazolopyrimidine derivative to prevent and/or treat skin diseases.