Lipinski's Rule of 5 Oxygen Rules
In Advanced Drug Delivery Reviews, 2001, 46, 3-26, (DOI) Lipinski and coworkers write:


  Too many hydrogen bond acceptor groups also hinder permeability across a membrane bi-layer. The sum of $\ce{N}$s and $\ce{O}$s is a rough measure of H bond accepting ability.


So, for the empirical rule of five it's simply the number, nothing more.



In the cited article, the situation for amides is addressed on page 19 in the context of log P calculations and correction factors that increase lipophilicity. Here, the authors write:


  PRX, a proximity correction factor for nitrogen
  and oxygen atoms that are close to one another
  topologically. [...] In addition, for each
  carboxamide group, we add an extra 1.0 and for
  each sulfonamide group, we add 2.0