Also written: signature, key signatures
A key signature says which notes of a key are sharp or flat. The key of D has 2 sharps: F# and C#. The key of F has 1 flat: Bb.
Sharps come in the order F#, C#, G#, D#, A#, E# and B#. Flats come in the order Bb, Eb, Ab, Db, Gb, Cb and Fb. So a count says which notes they are.
Written music puts the signature at the start of every line of the staff; this site says it in letters and shows it on the circle of fifths.
This example plays D, E, F#, G, A, B, C#, D: the D major scale.