Of her original 25 apples, Sarah gave five to friends, meaning she has no more than 25-5=<<25-5=20>>20 apples available to give to teachers.
She ate one while walking home, meaning she had no more than 20-1=<<20-1=19>>19 apples available to give to teachers.
And since she had three apples remaining when she got home, then the amount she had given to teachers was 19-3=<<19-3=16>>16 apples.
#### 16