Notice that f remains sharped and the added sharp is the seventh of the scale. This is always the case, the added sharp is the seventh of the new scale.
The fifth of D is a and has three sharps:—
A b c# d e f# g# A
1 2 3∼ 4 5 6 7∼8
The fifth of A is e and has four sharps:—
E f# g# a b c# d# E
1 2 3∼4 5 6 7∼8
The fifth of E is b and has five sharps:—
B c# d# e f# g# a# B
1 2 3∼4 5 6 7∼ 8
The fifth of B is f# and has six sharps:—
F# g# a# b c# d# e# F#
1 2 3∼4 5 6 7∼ 8
Notice that e# is not a black key but the white key which has been previously considered as f. It must be called e# to retain the alphabetical order.